home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / telecomm / 515 / staladbk / stald_bk.asc
Text File  |  1991-10-21  |  106KB  |  2,404 lines

  1.  
  2.  
  3.  
  4.                   >>>  ST ALADDIN SCRIPT TUTORIAL <<<
  5.                   """""""""""""""""""""""""""""""""""
  6.                     ~ A T/TalkNET Online Bookette ~
  7.  
  8.                                    By
  9.  
  10.                               Fred H. Koch
  11.  
  12.  
  13.  
  14.  
  15.                      (C)opyright 1991 Fred H. Koch
  16.                           All rights reserved
  17.  
  18.                    ~ A T/TalkNET ONLINE PUBLICATION ~
  19.  
  20.                     T/TalkNET OnLine Publishing Co.
  21.                            ATTEN: John Peters
  22.                          5102 Galley Rd. 115/B
  23.                       Colorado Springs, CO. 80915
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30. WHY ST ALADDIN?   Well, I started using Aladdin back in March, and life  
  31. """""""""""""""   has never been the same.  ST Aladdin is by far the most 
  32. useful program I've ever had.  My Atari practically never leaves the  
  33. program.
  34.  
  35.     My Aladdin use has changed much in the last three months.  The first
  36. month was spent trying the program out.  I spent most of my time here in
  37. the ST Aladdin RT.  I continued my old habits, and frequented the ST RT,
  38. as well.  I made about 100 calls and was online about 8 hours.  My GEnie 
  39. costs were about the same as always.
  40.  
  41.     The second month, I became braver.  I started exploring computer RT's
  42. and my inexperience with ST Aladdin led to many expensive connections 
  43. downloading thousands of unwanted messages.  I still made about 100  
  44. calls, and was online about 12 hours.  My bill was $60 compared to the 
  45. usual $15, though.
  46.  
  47.     The third month, I discovered the Star*Basic services, i.e. free
  48. stuff.  I had never been able to use these public discussions because 
  49. exploration was so difficult manually.  I've found these area extremely 
  50. interesting, and now rarely go to the computer RT's at all.  Heck, my 
  51. Atari is always in Aladdin, and that works fine, so there are few 
  52. questions that I need resolved.
  53.  
  54.     My online hours has shot up to 19, but my costs have now gone down to
  55. the $10-$15 range.  At $15/19 hours ($.78/hr), the Aladdin-GEnie combo
  56. is a great deal.
  57.  
  58.     I just wanted to let you know what a great program you've developed 
  59. and how one happy camper is making use of it. 
  60.                  (M.MILLS, CAT3, TOP5, MSG:79/M1000)
  61.  
  62.  
  63.  
  64.  
  65.                             >>> PREFACE <<<
  66.                             """"""""""""""""
  67.  
  68. ST ALADDIN SCRIPT TUTORIAL   The purpose of the ST Aladdin Script 
  69. """"""""""""""""""""""""""   Tutorial is to introduce ST Aladdin users
  70. to scripts.  Scripts not only automate your session on GEnie using ST 
  71. Aladdin, but also add capabilities which are not directly provided in 
  72. ST Aladdin.  These tutorials were originally published in GEnie Lamp, 
  73. the Atari ST online magazine of GEnie.  They are based on ST Aladdin 
  74. version 1.2a and the GEnie menu structure of March 1991.  The examples
  75. and commands are specific to ST Aladdin and GEnie, but the principles 
  76. explained apply to writing scripts for any telecommunications program.
  77. Examples of ST Aladdin scripts can be found on GEnie in the ST Aladdin
  78. RT Library.  Log onto GEnie and type M1000 to enter the ST Aladdin RT.
  79. Search the library for SCRIPT to find the current files.
  80.  
  81.  
  82.  
  83.  
  84. ACKNOWLEDGMENTS   I wish to say thanks to numerous persons who assisted
  85. """""""""""""""   in creating the articles which make-up this booklet.  
  86. John Peters for developing the idea behind Online Booklets and my wife 
  87. Linda for having the patience to allow me the time to produce the 
  88. tutorials.  I can't forget all the people on the GEnie ST Aladdin RT who
  89. asked questions and encouraged script development.  Perhaps most of all I
  90. have to thank Gordon and Tim for writing ST Aladdin, without which I would
  91. have remained an infrequent user of GEnie.
  92.  
  93.  
  94.  
  95.                        >>> TABLE OF CONTENTS <<<
  96.                        """""""""""""""""""""""""
  97.  
  98.  INTRO TO SCRIPTS ........ [PT1]        PROBLEMS WITH SCRIPTS ... [PT2]
  99.  
  100.  TEXT AND VARIABLES ...... [PT3]        CONDITIONAL BRANCHES .... [PT4]
  101.  
  102.  UNCONDITIONAL BRANCHES .. [PT5]        FILE COMMANDS ........... [PT6]
  103.  
  104.  OTHER COMMANDS .......... [PT7]        INTRO, INTERRUPTED ...... [PT8] 
  105.  
  106.  COMMAND SUMMARY ......... [PT9]        COMMAND INDEX .......... [PT10]
  107.  
  108.  
  109. [IDX]
  110. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  111. READING A BOOKETTE   T/TalkNET has incorporated a unique indexing system
  112. """"""""""""""""""   to help make reading the magazine easier.  To 
  113. utilize this system, load this Bookette into any ASCII word processor or
  114. text editor.  In the index you will find the following example:
  115.  
  116.                      PROBLEMS WITH SCRIPTS ... [PT2]
  117.  
  118.      To read this chapter, set your find or search command to [PT2].  If
  119. you want to scan all of the articles, search for [EOA].  [EOF] will take
  120. you to the last page, whereas [IDX] will bring you back to the index.
  121. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                    >>> ST ALADDIN SCRIPT TUTORIAL <<<
  129.                    """"""""""""""""""""""""""""""""""
  130.                              ~ Fred H. Koch ~
  131.  
  132.  
  133.  
  134.  
  135. CHAPTER 1
  136. """""""""
  137.     [PT1]
  138.  
  139.                         >>> INTRO TO SCRIPTS <<<
  140.                         """"""""""""""""""""""""
  141.  
  142.      There is much talk about scripts among the telecommunications crowd.  
  143. Scripts can make telecommunicating much easier, reducing or even 
  144. eliminating many manual steps.  This article and those which follow will 
  145. discuss how to create scripts, specifically for ST Aladdin, but many of 
  146. the items discussed will apply to creating scripts for any terminal 
  147. program.
  148.  
  149.     A script is a list of instructions which the terminal program can use 
  150. to perform the desired actions, with little or no operator intervention.  
  151. Each terminal program which supports scripts does so in its own unique 
  152. fashion.  Many of the capabilities are similar, but exactly how each is 
  153. implemented and the exact format is different.
  154.  
  155.     Even if you have no programming experience, simple scripts can be 
  156. created to make your telecommunicating easier and faster.  Any action 
  157. which you perform frequently, using the same steps, is a candidate for 
  158. using a script.  Most scripts allow using variables so the same steps can 
  159. be performed with different inputs, reducing the repetitiveness, and 
  160. increasing the usefulness.
  161.  
  162.     Once a script is created, anyone who has the same terminal program can
  163. use the script by knowing what inputs the script needs.  They don't have 
  164. to understand how the script works or know the commands the script uses.  
  165. This allows people to perform operations faster and easier without having
  166. to actually learn or remember the process themselves.
  167.  
  168.     Now for how to actually write a script.  The first step is to perform 
  169. the desired operation manually, exactly the way you want the script to do 
  170. it each time, and capture the operation as it is done.  This captured list
  171. of actions is the basis for your entire script, so it must be done
  172. correctly, if not your script will not do what you want. This may take 
  173. some practice to insure the actions are recorded the way you really want 
  174. things to happen.  You can use a capture which includes mistakes and extra
  175. steps, but this makes script writing much more difficult and tends to 
  176. introduce errors in the final product.
  177.  
  178.     Once the capture is made, it is best to print the file so easy 
  179. reference can be made to each step.  Since a script is nothing more than a
  180. series of instructions, the capture will provide the sequence of steps for
  181. the script.  The printout also allows reference to the exact key words 
  182. used by the called system when requesting information.  These key words 
  183. are used by the script to know when to pass the next piece of information.  
  184. The script works by recognizing a request from the called system (or host) 
  185. and providing the proper response for that request.
  186.  
  187.     All scripts contain two key types of actions.  The first is 
  188. recognizing the host system request for input (often called a prompt), and
  189. the second is sending the proper response.  Recognizing the prompt is 
  190. nothing more than matching characters.  The script waits until the proper 
  191. sequence of characters is received before proceeding.  An ST Aladdin 
  192. example is:
  193.  
  194.     WAITFOR "skip?"
  195.  
  196.     The script will not proceed until that exact sequence of characters is
  197. received.  Exact sequence is important.  Since characters are received one 
  198. at a time, and S is different than s to most scripts, the exact sequence 
  199. makes a big difference in getting a script to work properly.  If you do 
  200. not tell the script to watch for the correct sequence of characters, it 
  201. will patiently wait all day for what you told it to wait for, not knowing 
  202. it will never come.  In the above example, if
  203.  
  204.      WAITFOR "Skip?"
  205.  
  206.     had been used, the script would never go to the next step, since the 
  207. capital Skip will not be received from the called system, only skip.
  208.  
  209.     Choosing enough characters to allow the script to proceed when it 
  210. should, but not too many to allow line noise to confuse the script, is a 
  211. delicate balance in some cases.  Line noise is that crackle or pop you 
  212. hear when listening to a telephone conversation.  We don't think much 
  213. about it, but to a computer, it is significant.  That crackle or pop can 
  214. produce an unwanted character in the string of characters coming to your 
  215. computer.  In the above example, with line noise, the skip? might look 
  216. like this:
  217.  
  218.     s{kip?
  219.  
  220.     when coming to your computer.  The script is looking for the exact 
  221. sequence of characters you entered, so it will not recognize s{kip? as the 
  222. proper prompt, and will not proceed.  This is where the balance between 
  223. enough characters to uniquely define the prompt and as few as possible to 
  224. reduce the impact of line noise, comes in.  If the computer receives:
  225.  
  226.     is this the time to skip?
  227.  
  228.     as part of a message it would dutifully proceed with the next 
  229. instruction after receiving the skip? from the message.  It doesn't know 
  230. the skip? it received is part of a message and not a system prompt.
  231.  
  232.     Choosing the proper words or phrases can be one of the more 
  233. frustrating parts of trying to write a working script.  It generally isn't 
  234. a problem, but can be if a few precautions to provide unique matches are 
  235. not taken.
  236.  
  237.     Most BBS systems realize the problems which can occur if the system 
  238. prompts are not unique, so they try to make them distinct from other 
  239. naturally occurring phrases.  As long as you take the time to recognize 
  240. what it is that makes the prompt unique there will be no problem.  When in 
  241. doubt, make the script phrase to be looked for match the whole prompt.  
  242. This will reduce the risk of the script proceeding when it shouldn't.  
  243. Whenever a script proceeds before you intended, an early match is the most 
  244. probable reason.  Make the required character match more descriptive to 
  245. correct the problem.  If line noise is a problem, the phrase can be 
  246. shortened later, after you determine the script works.
  247.  
  248.     Fortunately, GEnie uses the same prompt for most of its requests. 
  249. Aladdin uses this unique request format to simplify its script writing 
  250. with the command WAITFORPROMPT.  This command will recognize any GEnie 
  251. standard prompt and proceed with the script sequence.
  252.  
  253.     The next step following recognizing the proper prompt is providing the 
  254. proper response to the prompt.  This is much easier since you have already 
  255. done it once manually.  There is always a command to tell the script to 
  256. send a sequence of one or more characters, in ST Aladdin it is SEND or 
  257. SENDLINE.  SEND will send the desired character(s) with no carriage 
  258. return, where SENDLINE will provide the carriage return and line feed 
  259. after the character(s) is sent.  Following the above example, if the 
  260. proper response is Y, the script line for ST Aladdin would be:
  261.  
  262.     SENDLINE "Y"
  263.  
  264.     This would cause the terminal program to send the character Y after 
  265. receiving the skip? prompt, instructing the called system to proceed.
  266.     Line noise can still be a problem when sending the response.  If 
  267. the called system is expecting Y or YES and line noise causes it to 
  268. receive 
  269.  
  270.     {Y
  271.  
  272.     the system will probably not proceed.  It may provide an error message 
  273. such as GEnie's:
  274.  
  275.     Unrecognized command [{Y]
  276.  
  277.     or may just repeat its previous prompt.  Since the called system does 
  278. not generally evaluate the response until a carriage return is received, 
  279. it includes any line noise characters in the response.  Line noise in the 
  280. prompt or the response can cause a problem with the script proceeding.  
  281. Ways to deal with line noise will be covered in a later article.
  282.  
  283.     With only these two commands, some very useful scripts can be created.  
  284. One of the first scripts I created uses only these two commands, and 
  285. allows automated log on to the local bulletin boards I frequent.
  286.  
  287.     Before quitting this article, let me give an example of a simple 
  288. script creation process using only the above two commands.  The script 
  289. will be very simple and of limited use, since the same actions are already 
  290. contained within ST Aladdin, but it will serve to demonstrate the process.
  291.  
  292.     I begin the capture with Aladdin and select log onto ST Aladdin BB. 
  293. Next I perform all the actions manually I want the script to be able to 
  294. perform.  The capture shown below is abbreviated to contain only the 
  295. significant portions for space reasons.  My comments will be in {} braces.
  296.  
  297. {preceded by the initial GEnie log on sequence accomplished by Aladdin.}
  298.  
  299. Category  1 Welcome to the ST Aladdin BB
  300. 1 ?REA ALL NEW CAT=1-99 NOR
  301. {1 ? is the prompt provided by GEnie} 
  302. {I enter REA ALL NEW CAT=1-99 NOR} 
  303. {which means read all new messages in categories 1-99 with no reply} 
  304. {GEnie responds with the new messages}
  305. ************ 
  306. Topic 10        Fri Feb 01, 1991 
  307. R.BAUKNECHT [RICK]           at 20:48 CST 
  308. Sub: WHAT IS ALADDIN ST -VS- ALADDIN PC ?
  309. WHAT IS THE DIFFERANCE BETWEEN ALADDIN PC AND ALADDIN ST?*S 
  310. 4 message(s) total. 
  311. ************ 
  312. ------------ 
  313. Category 1,  Topic 10 
  314. Message 4         Sun Feb 03, 1991 
  315. R.BAUKNECHT [RICK]           at 23:13 CST
  316. YOU`RE RIGHT IT IS SIMPLE,THANKS FOR THE HELP!   I GUESS I`LL MOVE ON 
  317. DOWN TO ALADDIN PC. RICK 
  318. ------------
  319. {other messages follow}
  320. 1 ?BYE
  321. {after the last message GEnie responds with the prompt again} 
  322. {I enter BYE to end the GEnie session}
  323.  
  324.  
  325.     After ending the capture, I have all the information needed to create 
  326. a script to check for new messages any time I want.  Admittedly this is 
  327. very simple but we have to walk before running.  To create the script I 
  328. look at each system prompt provided and the response I want to make.
  329.  
  330.     We will keep it simple and log on manually each time.  All the script 
  331. has to do is provide the proper responses to retrieve the new messages.  
  332. The first thing we need to do is provide GEnie the proper command.  We do 
  333. not need to wait for the prompt since it is already there before we begin 
  334. the script.  Knowing where to start the script is not always obvious, more 
  335. on that in a later article.
  336.  
  337.     ST Aladdin has some requirements for all scripts, namely telling it 
  338. where the script begins and ends using the SCRIPT and ENDSCRIPT commands.  
  339. Each script must also have a unique number from 3 to 9.  A title line of 
  340. up to 30 characters can be added which is displayed when listing the saved 
  341. scripts.  Providing for these requirements, the first script command is:
  342.  
  343.  
  344. SCRIPT 3 Read New messages
  345.  
  346.     To actually send the desired command to GEnie the next command is:
  347.  
  348. SENDLINE "REA ALL NEW CAT=1-99 NOR"
  349.  
  350.     GEnie will respond with all the new messages.  We want the script to 
  351. proceed after all new messages are displayed.  We could use the WAITFOR "1 
  352. ?" command, but if a message contained 1 ? the script would proceed before 
  353. we wanted.  To reduce the problem of message content confusing the script, 
  354. we use the unique prompt command in ST Aladdin's script language.  The 
  355. next command is then:
  356.  
  357. WAITFORPROMPT
  358.  
  359.     The script will not proceed until GEnie sends the unique prompt. After 
  360. receiving the prompt, in this case 1 ? the script must log off. We could 
  361. just use SENDLINE "BYE", but ST Aladdin provides a special command to log 
  362. off called LOG OFF so we will use it.
  363.  
  364. LOG OFF
  365.  
  366.     To finish the script properly we have to tell Aladdin the script is 
  367. done with the command:
  368.  
  369. ENDSCRIPT
  370.  
  371.     That is it.  The complete script without the comments is:
  372.  
  373. SCRIPT 3 Read New messages
  374. SENDLINE "REA ALL NEW CAT=1-99 NOR" 
  375. WAITFORPROMPT
  376. LOG OFF
  377. ENDSCRIPT
  378.  
  379.     Of course there are lots of other things we would like the script to 
  380. do.  Perhaps log onto GEnie, open and close the capture for us and allow 
  381. reading more than just the new messages.  These are easily accomplished, 
  382. but that will be saved for a future article.
  383.  
  384.     To get this script into Aladdin we have to select Edit User Scripts 
  385. from the File menu and type the above five lines into the editor. Aladdin 
  386. does not care if the commands are upper or lower case, but the case of the 
  387. characters to be matched is very significant.  Pressing ESC or clicking on 
  388. the window close box will save the script.  The number assigned to the 
  389. script is not critical, as long as it is the next number in the script 
  390. list, so if there were already 4 scripts this one could be number 5.  
  391. Aladdin does not seem to like scripts being out of sequence.
  392.  
  393.     To use the script we need to start the capture, log onto a GEnie 
  394. bulletin board with Aladdin, select Do User Script from the Terminal menu, 
  395. click on Read New messages and click on OK.  If we made no typing mistakes 
  396. in the script, Aladdin will send the read new messages command, GEnie will 
  397. respond with the new messages, then Aladdin will log off. Since nothing in
  398. this script is unique to the ST Aladdin BB it could be used with any 
  399. bulletin board on GEnie.  With some minor changes, we could just select 
  400. the proper script and Aladdin would do the rest for us.  In fact that is 
  401. exactly what happens when using AutoPass 1 or 2 in Aladdin.  In a future 
  402. article we will change the script to make it really useful, not just a 
  403. duplication of what Aladdin can already do.
  404.  
  405.  
  406.  
  407.  
  408. CHAPTER 2
  409. """""""""
  410.     [PT2]
  411.                      >>> PROBLEMS WITH SCRIPTS <<<
  412.                      """"""""""""""""""""""""""""" 
  413.  
  414.     Last time I gave a quick intro to what scripts are, why some people 
  415. like them, looked at two commands always used in a script, and explained 
  416. the basics of writing a script.  This week we will take a look at why 
  417. scripts don't always work the way we planned, some of the more common 
  418. problems and most importantly, how to fix those problems.
  419.  
  420.     First let me reemphasize script writing is not difficult, it does 
  421. require close attention to detail, but it is not difficult.  Not paying 
  422. close enough attention to detail is one of the most common problems with 
  423. writing scripts.
  424.  
  425.     Aladdin provides some checks on the wording or syntax of a script. If 
  426. it encounters a word it doesn't understand as a command it will display 
  427. a SCRIPT ERROR: message, and the script will abort.  Most times it is just 
  428. a spelling error in one of the commands or forgetting to provide the item 
  429. the command needs to work with (called the argument).  The message 
  430. displays the line that caused the problem with a hint to what the problem 
  431. was, if Aladdin knows.  To correct it, examine each line to see that it 
  432. matches the correct command and provides the argument the command needs.  
  433. Aladdin commands can be upper or lower case.
  434.  
  435.     As I mentioned last time, a script is just a list of instructions some
  436. of which wait for a prompt and others that provide the information the 
  437. prompt is requesting.  If the script is waiting for the wrong prompt, it 
  438. won't proceed when you expect it to.  Little things count a lot when 
  439. waiting for a prompt.  The script matches characters one at a time.  If it
  440. is expecting Skip and receives skip, it won't proceed. This includes 
  441. leading and trailing spaces if they are included in the script.
  442.  
  443.     When trying to run a newly created script, it is always a good idea to 
  444. capture the session just in case problems occur.  If there is a problem 
  445. you can log off and check the capture to see where the problem occurred 
  446. and what the discrepancy was.  Two frequent problems are the script not 
  447. proceeding or proceeding too soon.
  448.  
  449.     If the script will not proceed when expected, look at the exact prompt
  450. - there has to be a mismatch between the string the script is looking for
  451. and the one sent by the system.  Solving this problem requires close 
  452. examination of the script commands and the captured file. Make sure all 
  453. typing is correct, including capitalization and those punctuation marks 
  454. which are not easily distinguished, such as a comma and period, semicolon 
  455. and colon.  If you can't see what the difference is, try using the search 
  456. function of your text editor.  Type in the string you told the script to 
  457. look for and see if the search stops at the prompt in the capture and at 
  458. the string in the script.  Be sure to use the case sensitive search so 
  459. capital letters are distinguished.  If the search doesn't find the prompt 
  460. but does find your script command, there is a mismatch which must be 
  461. fixed.  Don't forget to check the spaces in the string, including leading 
  462. or trailing, they are significant when used in the script WAITFOR string.
  463.  
  464.     One of the easiest ways to reduce typing errors when creating a new 
  465. script is to load the capture into your text editor.  Once the capture 
  466. is available, you can either edit the capture, deleting the unimportant 
  467. lines and adding the proper WAITFOR and SEND commands before the 
  468. appropriate text, or cut and paste the information into the script.
  469.  
  470.     If the script proceeds too early, then the string the script was 
  471. waiting for matched something else besides the prompt.  You need to make 
  472. the string more descriptive.  Most often this means looking for some 
  473. unique character sequence that appears only in the prompt.  Again using 
  474. the search feature of your text editor is a good check.  Start at the 
  475. point in the capture where the script last worked correctly and search for 
  476. the string you entered in the script.  The search should find the string 
  477. before getting to the system prompt, in which case you need to find some 
  478. way to change the script string to make it unique.  The search feature is 
  479. a good way to test the new string to make sure it isn't found too early.  
  480. Usually adding the punctuation which ends the prompt will do the trick.  
  481. Remember, the script is checking all characters received for a match, it 
  482. can't distinguish one string from another, if it matches, the script will 
  483. proceed.
  484.  
  485.     The Aladdin WAITFORPROMPT command can be a big help in preventing 
  486. confusion about when the script should proceed.  It not only looks for 
  487. the prompt character set in the Aladdin preferences, but also checks 
  488. that no other characters follow the prompt.  This insures the host is 
  489. waiting for a response before the script continues.  If the information
  490. the script needs to send is requested at a system prompt use the 
  491. WAITFORPROMPT command, it can prevent many problems.
  492.  
  493.     Just so you don't get confused when trying to capture an Aladdin 
  494. script session.  Aladdin can only have one capture open at a time.  If you 
  495. have a capture started and the script being run also opens a capture, the 
  496. first capture will be closed and not reopened, even when the script 
  497. capture is closed.  To get around this you will need to either open your 
  498. capture again when the script capture is done, or disable the script 
  499. capture during the testing phase.  I will discuss the ST Aladdin capture 
  500. command in another article.
  501.  
  502.     I discussed line noise last time, but only briefly touched on 
  503. remedies.  Line noise can't always be prevented, and if present is a sure 
  504. source of problems for scripts.  Line noise causes extra characters to be 
  505. received from the host system which causes the script to not recognize the 
  506. prompt.  The script will keep looking for the correct match, but the host 
  507. system will only send the prompt once and wait for a response before 
  508. proceeding.  Thus the script is waiting for a string which was already 
  509. sent and the host is waiting for a response which the script will not 
  510. send, and they wait and wait until a time out occurs.
  511.  
  512.     Several things can be done to help the line noise problem.  If there 
  513. is only occasional line noise, making the prompts and responses as short 
  514. as possible will reduce the chance of the stray line noise characters 
  515. hitting during these critical transmission times.  If a bad response is 
  516. sent, there is little to be done except abort the script with ESC and 
  517. start over.
  518.  
  519.     ST Aladdin provides some help with missed prompts.  The FIX function 
  520. will try to rematch GEnie and Aladdin.  FIX (F4) will tell the Aladdin 
  521. script to go ahead with the next step.  If a single prompt was missed due 
  522. to line noise, this should put things back in sync.  I have never had to 
  523. use it, but it is the only way to try to fix a script and host mismatch 
  524. without logging off and starting over.
  525.  
  526.     If line noise is present on some calls and not others, try logging off 
  527. and calling back when you have a noisy connection.  Each connection can be 
  528. over a different set of lines.  The next hook up could be much better.  
  529. This is especially true when making a call to another city as with most 
  530. GEnie connections.  I heard a telephone representative explain that with 
  531. computer switching and automatic routing, a call from Colorado Springs to 
  532. Denver (45 miles for those unfamiliar with Colorado) could go through 
  533. California, Washington state and North Dakota before getting routed to 
  534. Denver.  Now you can see why some calls are noisier than others.
  535.  
  536.     If line noise is really bad, changing to a lower baud rate will 
  537. generally reduce or eliminate it.  The faster the transmissions the 
  538. cleaner the lines need to be.  If line noise is bad, slowing down the baud
  539. rate will sometimes even save time, since less retries are needed.
  540.  
  541.     Another area of possible problem is where to start a script.  The 
  542. starting point depends on when the script will be activated.  In the 
  543. example last time, the script was activated after we navigated to the 
  544. proper bulletin board and the host was ready to receive the next request.  
  545. In this case the script started with a command to send our request.  This 
  546. is the case for most Aladdin scripts, because Aladdin takes care of the 
  547. initial connection to GEnie.  That is why it is even more important to 
  548. start a script at the proper place with Aladdin than some other script 
  549. languages.  If you start at the wrong place, the script and GEnie will be 
  550. out of sync with no way to get matched up again.  The convenience of 
  551. having the same prompt for most requests is also a hazard if you get 
  552. started wrong.  There is no easy way for the script to tell it isn't where 
  553. it should be.  Referencing the capture used to create the script is of 
  554. great help in determining the starting point.
  555.  
  556.     To fully automate a script, the first command which interacts with 
  557. GEnie is usually the LOG ONTO command.  This command tells Aladdin to log 
  558. on to the specified area of GEnie.  It will use the Aladdin settings to 
  559. call GEnie, provide your user ID and password, then move to the specified 
  560. page and menu selection, if provided.  A quirk of the LOG ONTO command is 
  561. it does not return control to the next script command until after the 
  562. GEnie system prompt is received.  Consequently the next command after the 
  563. LOG ONTO command is always going to be a SEND or SENDLINE command.  GEnie 
  564. is waiting for a response and the script must provide it.
  565.  
  566.     The LOG ON command is available too, but it only logs onto GEnie and 
  567. leaves you at the opening page prompt.  Most times the script needs to be 
  568. on some other page to accomplish its task, so it saves time to use the LOG 
  569. ONTO command instead.
  570.  
  571.     Now lets use the LOG ONTO command to make the read new messages script 
  572. from the last article a little more useful.
  573.  
  574.     Instead of having to log onto GEnie manually as we did previously, we 
  575. can use the LOG ONTO command to instruct the script to take us to the 
  576. bulletin board where we want to read messages.
  577.  
  578.     LOG ONTO "1000;1"
  579.  
  580. tells Aladdin to instruct GEnie to immediately go to page 1000 menu item 1 
  581. at the completion of the log on sequence.  Page 1000 is the ST Aladdin 
  582. page.
  583.  
  584.     Because the LOG ONTO command stops after GEnie has already sent the 
  585. system prompt for page 1000 menu item 1, the script must continue with the 
  586. desired response to that prompt.  In the read new messages case the script 
  587. proceeds with the command to read new messages.  Since this is where the 
  588. previous script started the rest remains the same.  To add the new command 
  589. to the script, just insert the command after the SCRIPT 3 command.  The 
  590. modified script is shown below.
  591.  
  592. SCRIPT 3 Read New messages 
  593. LOG ONTO "1000;1" 
  594. SENDLINE "REA ALL NEW CAT=1-99 NOR" 
  595. WAITFORPROMPT 
  596. LOG OFF 
  597. ENDSCRIPT
  598.  
  599.     If we want to look at the messages on another bulletin board we 
  600. need to edit the page number in the LOG ONTO command.  That is a pain, 
  601. but using a variable for the page number would allow us to enter the 
  602. page number without physically editing the script each time.  Variables 
  603. can make scripts very flexible and much more useful.  How Aladdin 
  604. scripts use variables will be the topic of the next article. 
  605.  
  606.  
  607.  
  608.  
  609. CHAPTER 3
  610. """""""""
  611.     [PT3]
  612.  
  613.                        >>> TEXT AND VARIABLES <<<
  614.                        """"""""""""""""""""""""""
  615.  
  616.      Now that we have covered how to create simple scripts, it is time to 
  617. start looking at the more powerful features of scripts.  One of the most 
  618. powerful features is the use of variables.  By using variables within a 
  619. script we can use the same script to accomplish the same operation in many 
  620. different areas of GEnie.  No longer will the script need to be modified 
  621. for each area to be accessed.
  622.  
  623.      Variables in a script are the same as variables in math.  They are 
  624. characters which represent other characters and can be acted upon just as 
  625. if the represented characters had been used in the first place.  The 
  626. difference from math is that script variables can represent letters as 
  627. well as numbers.
  628.  
  629.      The advantage of using variables in a script is the script can be 
  630. designed to request certain values when started and then use those values 
  631. as the script executes.  These values can be almost anything, but the most 
  632. common uses are for RT page numbers, file names or numbers, menu 
  633. selections, and other choices normally selected when using GEnie manually.
  634.  
  635.      If the script is going to request the input of these values then 
  636. there must be some way for the script to print a message on the screen. 
  637. This is exactly what the NOTE command is for.  The NOTE command will 
  638. display whatever follows it on the screen.  The format is:
  639.  
  640.     NOTE "one or more characters" 
  641.  
  642. the characters inside the quotes will be displayed on the screen when the 
  643. command is reached during script execution.
  644.  
  645.      The NOTE command can use other characters to mark the string of 
  646. characters which is to be displayed.  The other characters are ( ),[ ],
  647. { }, ` ' or < >.  Which ever one starts the string, the corresponding 
  648. character must end the string.  The variety of characters which may be 
  649. used allows including one or more of the characters within the string to 
  650. be displayed.  For example, if you wanted to quote something to be 
  651. displayed on the screen, you could use the [ ] characters to mark the 
  652. string to be displayed so the quotes would be displayed.  Such as
  653.  
  654.     NOTE [Look for the word "help" on the screen.]
  655.  
  656.      The NOTE command with no text to display will display a blank line or 
  657. be the equivalent of pressing RETURN in a text editor.
  658.  
  659.      Another command which goes along with the NOTE command is the CLEAR 
  660. command.  This command will clear the screen.  This is useful when 
  661. starting a script to be sure your instructions aren't lost in previous 
  662. text displayed on the screen.  The format is:
  663.  
  664.     CLEAR
  665.  
  666.      Now back to variables.  ST Aladdin allows 10 user defined variables 
  667. represented by the numbers 0 thru 9.  These variables can be set within 
  668. the script, or set by entering characters from the keyboard.  The two 
  669. commands are SETSTRING and GETSTRING respectively.
  670.  
  671.      The SETSTRING command will assign the specified characters to the 
  672. specified variable.  The format is:
  673.  
  674.     SETSTRING 1 "This is the string" 
  675.  
  676. After the script executes this line the string variable 1 will be replaced 
  677. by the phrase, This is the string, anywhere it is found in the script.
  678.  
  679.      The GETSTRING command will assign the characters entered from the 
  680. keyboard into the specified variable when the RETURN key is pressed. The 
  681. format is:
  682.  
  683.     GETSTRING 1
  684.  
  685. After the script executes this line the script will wait for the RETURN 
  686. key to be pressed.  When RETURN is pressed the script will assign the 
  687. characters entered before RETURN was pressed to the variable 1.  The 
  688. GETSTRING command is limited to a single line of up to 79 characters. If 
  689. the ESC key is pressed before the RETURN key, the GETSTRING command will 
  690. be aborted and the variable will be cleared.
  691.  
  692.      When using the GETSTRING command it is very beneficial if there is a 
  693. NOTE command immediately before the GETSTRING command stating what 
  694. information the script needs.
  695.  
  696.      The variables created using the SETSTRING and GETSTRING commands can 
  697. be used in the script the same way any other string is used.  A % sign is 
  698. placed in front of the variable number to identify it as a variable and 
  699. not a number.  An example is:
  700.  
  701.     SETSTRING 1 "This is the string"  
  702.     NOTE "%1" 
  703.  
  704. would display on the screen:
  705.  
  706.     This is the string
  707.  
  708.      Variables can be combined to form a single string by placing them 
  709. together just as letters and words can be placed together.  An example is:
  710.  
  711.     SETSTRING 1 "This is "  
  712.     SETSTRING 2 "the string"  
  713.     NOTE "%1"  
  714.     NOTE "%2"  
  715.     NOTE "%1%2" 
  716.  
  717. would display on the screen:
  718.  
  719.     This is 
  720.     the string 
  721.     This is the string
  722.  
  723.      Variables cannot be broken back down into pieces once created. That 
  724. means you can't take a sting which is "This is the string" and only use 
  725. the "This is" part of it.  They can be put together but not pulled apart.
  726.  
  727.      Now we will use the NOTE and GETSTRING commands to make the Read new 
  728. messages more useful.  With these commands we can make the script much 
  729. more useful and even make it into something ST Aladdin doesn't do for us.
  730.  
  731.      By the script requesting which bulletin board to check messages on 
  732. the script will no longer need to be modified for each board to check. By 
  733. requesting a date to check messages after, the script will no longer be 
  734. limited to checking only new messages.  We could even have the script 
  735. request which categories to check so only selected categories would be 
  736. checked, but that will be left for a personal exercise if desired.
  737.  
  738.      A command which should be used any time the GETSTRING command is 
  739. going to be used for entering a GEnie command is the SUCCESS command.  I 
  740. will cover it in detail in the next article, but for now it tells the 
  741. script if the string was entered successfully or if the ESC key was 
  742. pressed to abort the entry.  Without using the SUCCESS command the ESC key 
  743. could be pressed and the script would try to proceed with an invalid 
  744. variable value.  The results are usually GEnie not knowing what to do and 
  745. the script staying online until ST Aladdin times out.
  746.  
  747.     The ECHO command determines if the script will display commands as 
  748. they are executed.  The default is ECHO ON which will display commands as 
  749. executed.  This is good when trying to see if a script is working as 
  750. planned, but tends to mess up the display for routine operations.  It is 
  751. best to turn ECHO OFF once you are sure the script works.
  752.  
  753.      Adding a CLEAR and some NOTE and GETSTRING commands the new script 
  754. looks like this:
  755.  
  756. SCRIPT 3 Read Messages 
  757. ECHO OFF 
  758. CLEAR 
  759. NOTE 
  760. NOTE "This script will retrieve messages from a GEnie bulletin board"  
  761. NOTE "starting at the specified date. Messages from all categories not"  
  762. NOTE "permanently ignored will be retrieved."  
  763. NOTE 
  764. NOTE "Be sure to start a capture file before running this script."  
  765. NOTE 
  766. NOTE "The ST Aladdin bulletin board is on page 1000."  
  767. NOTE "The Atari ST RT bulletin board is on page 475."  
  768. NOTE "Enter the page number of the bulletin board to retrieve 
  769.       messages."  
  770. NOTE "Press ESC at any time to abort the script."  
  771. GETSTRING 1 
  772. IF SUCCESS 
  773. NOTE "Enter the date to start reading messages as YYMMDD.(Year 
  774.       Month Day)"  
  775. GETSTRING 2 
  776. IF SUCCESS 
  777. LOG ONTO "%1;1"  
  778. SENDLINE "REA ALL ALL CAT=1-1000 DATE>%2 NOR"  
  779. WAITFORPROMPT 
  780. LOG OFF 
  781. ENDIF 
  782. ENDIF 
  783. ENDSCRIPT
  784.  
  785.      Now the script will not need to be modified to access any bulletin 
  786. board on GEnie.  There are still some improvements to be made though. It 
  787. would be nice if the script would open and close the capture for us, or 
  788. even remember the page number of our favorite bulletin boards. These can 
  789. be easily accomplished with a few more commands which we will look at next 
  790. time, one of which is the IF command used above in IF SUCCESS.
  791.  
  792.  
  793.  
  794.  
  795. CHAPTER 4
  796. """""""""
  797.     [PT4]
  798.  
  799.  
  800.                       >>> CONDITIONAL BRANCHES <<<
  801.                       """"""""""""""""""""""""""""
  802.  
  803.      Another major power feature of scripts is being able to skip certain 
  804. portions of a script when it doesn't apply to our current desired
  805. actions.  This capability is called branching and allows a single script  
  806. to do many different functions.
  807.  
  808.      Branching in scripts is very similar to branching in a program and  
  809. can be used in many of the same ways.  Don't let this scare you if you're 
  810. not a programmer.  This will be painless, I assure you, and not very hard  
  811. at all.  The branches used in ST Aladdin scripts are very simple and easy  
  812. to understand.
  813.  
  814.      The last script we completed allowed entry of the page number for  
  815. the GEnie bulletin board where we wanted to read messages.  If we use  
  816. branches, instead of having to enter the page number, we could enter a  
  817. number from a menu selection and allow the program to enter the proper  
  818. page number for us.  Lets look at how this can be done.
  819.  
  820.      There are two basic types of script branches.  Conditional and  
  821. unconditional.  Just as the name implies, conditional branches will be  
  822. taken if the conditions are right and will not be taken if they are  
  823. wrong.  Unconditional branches will be taken every time they are  
  824. encountered.
  825.  
  826.      Aladdin implements the conditional branch with the IF condition  
  827. command.  Whenever this statement is encountered in a script, the  
  828. condition is checked.  If it is met (true) the instructions which follow  
  829. the condition are completed.  If it is not met (false) the instructions  
  830. are skipped.  An example:
  831.  
  832.  
  833.     IF STRING 1 IS "F.KOCH" 
  834.        NOTE "Hello Fred." 
  835.     ENDIF 
  836.      
  837.      This is a very simple example.  When the script encounters this  
  838. conditional branch it checks the contents of variable 1 and makes the  
  839. comparison.  If script variable 1 contains the value F.KOCH the script  
  840. will print Hello Fred. on the screen.  If variable 1 contains something  
  841. else, the print Hello Fred. step is skipped.
  842.  
  843.      ST Aladdin allows nine different checks in the conditional branch.   
  844. This week I will only mention the three I use most.  With these three you 
  845. can create many powerful scripts.
  846.  
  847.      The ST Aladdin conditional branch format is:
  848.  
  849.      IF condition 
  850.        instruction 1 
  851.        instruction 2 
  852.        etc... 
  853.      ELSE 
  854.        instruction 8 
  855.        instruction 9 
  856.        etc... 
  857.      ENDIF
  858.  
  859.      The instructions between the IF condition and the ELSE will be  
  860. performed if the condition is met (true).  The instructions between the  
  861. ELSE and the ENDIF will be performed if the condition is not met (false).  
  862. The ENDIF marks the end of the conditional branch.  The ELSE part is 
  863. optional and if not included, the step following the ENDIF will be 
  864. completed immediately if the condition is not met.
  865.      
  866.      The ELSE is especially helpful if there are only two choices to be  
  867. made.  Using the previous example:
  868.  
  869.      IF STRING 1 is "F.KOCH" 
  870.        NOTE "Hello Fred." 
  871.      ELSE 
  872.        NOTE "Hello." 
  873.      ENDIF
  874.  
  875.      In this instance the user will always be greeted, even if variable 1 
  876. is not what was expected.
  877.      
  878.      I briefly mentioned the IF SUCCESS condition when talking about  
  879. variables in a previous script article.  IF SUCCESS determines if the  
  880. previous action was successful or not.  If the instruction executed right 
  881. before the IF SUCCESS branch was successful (true), the branch will be 
  882. taken, if it was unsuccessful (false), it will be skipped.
  883.     
  884.      The success conditions which may be checked are:
  885.  
  886.     CAPTURE        - was the capture started? 
  887.     ENDCAPTURE     - was the capture ended? 
  888.     ERASEFILE      - was the file erased? 
  889.     GETSTRING      - was a string entered? 
  890.     LOG ON         - was log on successful? 
  891.     LOG ONTO       - was the log onto successful? 
  892.     SNAPSHOT       - was the screen snapshot accomplished? 
  893.     WAITFOR        - was the specified string received? 
  894.     WAITFORPROMPT  - was the prompt received? 
  895.     WAITUNTIL      - was the specified time reached? 
  896.     XMODEM         - was the XMODEM operation completed?
  897.  
  898.      There is a special case, the SUCCESS command.  This is different  
  899. from the IF SUCCESS branch command.  The SUCCESS command will set the  
  900. condition of SUCCESS to force a branch or prohibit a branch, when the IF  
  901. SUCCESS branch is reached.  The SUCCESS command is either SUCCESS TRUE  
  902. which will force a branch or SUCCESS FALSE which will prohibit a branch.
  903.      
  904.      I mention all the script commands which could affect the IF SUCCESS  
  905. command for completeness, but some of them may never be used in your  
  906. scripts.  An example of the IF SUCCESS branch is shown with the GETSTRING 
  907. command in the script at the end of this article.
  908.  
  909.      The next branch condition to examine is the STRING condition.  This  
  910. command compares a script variable with the specified string and takes  
  911. the form:
  912.  
  913.      IF STRING digit verb string 
  914.         instruction 1 
  915.         etc... 
  916.      ELSE 
  917.         instruction 8 
  918.         etc... 
  919.      ENDIF
  920.  
  921. where:
  922.  
  923.      digit is 0 to 9 representing the ten possible script variables. 
  924.     
  925.      verb is either IS or HAS. 
  926.      
  927.        IS requires the variable match exactly, including upper/lower case.
  928.  
  929.        HAS requires the variable contain the specified string.
  930.  
  931.      string is the characters to match enclosed by string delimiters. 
  932.        (delimiters show where a string starts and stops, ie. " ")
  933.  
  934.      Examples of IF STRING digit IS were shown above.
  935.     
  936.      The HAS verb allows checking for a series of characters contained  
  937. within another string.  This is good if you aren't sure what else might  
  938. be included in a variable entry, but you know a specific group of  
  939. characters must be included.  An example is:
  940.  
  941.     IF STRING 1 HAS "F.KOCH" 
  942.        NOTE "Welcome Fred." 
  943.     ELSE 
  944.        NOTE "Welcome." 
  945.     ENDIF
  946.  
  947.      In this case if string 1 contained "My address is F.KOCH." there  
  948. would be a match.  No match would occur if the IS verb was used.
  949.   
  950.      IF CURRENTLINEHAS is the last condition I will discuss in this  
  951. article.  This command is used to determine if the current line being  
  952. received at the time the command is encountered contains the specified  
  953. characters.  The current line is ended by a carriage return. 
  954. The command has the form:
  955.  
  956.      IF CURRENTLINEHAS "string" 
  957.        instruction 1 
  958.        etc... 
  959.      ELSE 
  960.        instruction 8 
  961.        etc... 
  962.      ENDIF
  963.      
  964.      The comparison is case sensitive, like the other string comparisons, 
  965. so the string match must be exact.
  966.  
  967.      This command should work with any string received through the modem, 
  968. but I have only had success using it with prompt lines where GEnie waits 
  969. for a response from the script before proceeding.  This is partially due 
  970. to the fact if GEnie is not waiting for a response, it doesn't matter 
  971. what the script does, it won't change what GEnie is doing.  The other 
  972. reason is it is difficult to match the script response timing with GEnie 
  973. execution if GEnie is not waiting for the response.  (There are some 
  974. commands GEnie always responds to like BREAK, but I will exclude them for 
  975. now.)
  976.  
  977.      An example from the ST Aladdin manual is:
  978.      IF CURRENTLINEHAS "Enter #" 
  979.        SENDCOMMAND "C" 
  980.      ENDIF 
  981.  
  982.      If Aladdin receives a page prompt with the characters Enter #, it  
  983. will send the command C to turn off full prompts.
  984.      
  985.      I need to mention one caution with this command.  The comparison is  
  986. made as soon as a line is received, it does not keep checking the input  
  987. until the desired string is found.  It checks the first line received and 
  988. then continues.  This means if you want to check several lines for a  
  989. specific sequence of characters you will need to repeat the check for  
  990. each line until it is found.  If a line was received just prior to the  
  991. script encountering this conditional branch, that line is checked.  This  
  992. is a good way to determine if the current prompt line contains a  
  993. specified string.
  994.      
  995.      Next time I will discuss the unconditional branches in the ST  
  996. Aladdin script language.  Before I end lets see how to use a conditional  
  997. statement in the read messages script we have been building.
  998.      
  999.      A conditional branch can be used to provide the desired RT page  
  1000. number from a menu selection.  The modified script below shows one method
  1001. of accomplishing this.
  1002.  
  1003. SCRIPT 3 Read Messages 
  1004. ECHO OFF                           Don't display script commands 
  1005. CLEAR                              Clear the screen 
  1006. NOTE 
  1007. NOTE "This script will retrieve messages from a GEnie bulletin board" 
  1008. NOTE "starting at the specified date.  Messages from all categories not" 
  1009. NOTE "permanently ignored will be retrieved." 
  1010. NOTE 
  1011. NOTE "Be sure to start a capture file before running this script." 
  1012. NOTE 
  1013. NOTE "       Bulletin boards available" 
  1014. NOTE 
  1015. NOTE "       1  ST Aladdin bulletin board" 
  1016. NOTE "       2  Atari ST RT bulletin board" 
  1017. NOTE 
  1018. NOTE "Enter the menu number of the bulletin board." 
  1019. NOTE "Press RETURN with no number to enter a BB page number." 
  1020. NOTE "Press ESC at any time to abort the script." 
  1021. NOTE 
  1022. NOTE "       Menu Selection:" 
  1023. GETSTRING 1 
  1024. IF SUCCESS                         ESC not pressed 
  1025. IF STRING 1 IS "1"                 ST Aladdin BB selected 
  1026.  SETSTRING 1 "1000"               ST Aladdin BB page 
  1027. ELSE                               Menu item 1 was not selected 
  1028.  IF STRING 1 IS "2"               Atari ST BB selected 
  1029.    SETSTRING 1 "475"              Atari ST BB page 
  1030.  ELSE                             Menu item 1 or 2 was not selected 
  1031.    NOTE 
  1032.    NOTE "Enter the page number for the bulletin board to check." 
  1033.    GETSTRING 1 
  1034.  ENDIF 
  1035. ENDIF 
  1036. NOTE "Enter the date to start reading messages as YYMMDD.(Year Month Day)" 
  1037. GETSTRING 2 
  1038. IF SUCCESS 
  1039. LOG ONTO "%1;1" 
  1040. SENDLINE "REA ALL ALL CAT=1-1000 DATE>%2 NOR" 
  1041. WAITFORPROMPT 
  1042. LOG OFF 
  1043. ENDIF 
  1044. ENDSCRIPT
  1045.  
  1046.      Note: The indents for branch statements are not required, but it  
  1047. makes it easier to see which steps belong to which branches.
  1048.      
  1049.      By using unconditional branches with the conditional branches,  
  1050. placing one conditional branch inside another would not be necessary.   
  1051. This is called nesting for those who might be interested or have heard  
  1052. the term before.  Next time we will use unconditional branches to  
  1053. eliminate the nesting.
  1054.  
  1055.  
  1056.  
  1057.  
  1058. CHAPTER 5
  1059. """""""""
  1060.     [PT5]
  1061.  
  1062.                      >>> UNCONDITIONAL BRANCHES <<<
  1063.                      """"""""""""""""""""""""""""""
  1064.  
  1065.      Last time I explained using conditional branches in ST Aladdin 
  1066. scripts.  Branches allow a script to handle multiple situations without 
  1067. having to be rewritten for each one.
  1068.  
  1069.      Unconditional branches will be executed every time they are 
  1070. encountered.  At first this may seem useless.  If the script should 
  1071. branch to a certain place every time an unconditional branch is 
  1072. encountered, why is the branch needed at all.  Why not just write the 
  1073. steps in the desired sequence?  The examples below should make clear the 
  1074. usefulness of unconditional branches.
  1075.  
  1076.      ST Aladdin scripts allow two unconditional branches, the GOTO and 
  1077. CALL commands.  The CALL command might not be considered an unconditional 
  1078. branch by some, but in the current discussion of branches it fits very 
  1079. well.
  1080.  
  1081.      Both the GOTO and CALL commands direct the next script step to a 
  1082. different location than the line sequence would indicate.  The GOTO 
  1083. redirects the sequence permanently, that is the script will not return to 
  1084. the steps following the GOTO command unless another command redirects the 
  1085. sequence.  The CALL command redirects the sequence temporarily, upon 
  1086. completion of the redirected sequence, the steps following the CALL 
  1087. command are executed.  This is the major difference in the two commands.  
  1088. The details will be discussed below.
  1089.  
  1090.      The GOTO command causes the script to go to the specified label.  
  1091. This is useful if a certain portion of the script should be skipped for 
  1092. one reason or another.  The form is:
  1093.  
  1094.      GOTO label
  1095.  
  1096. The label can be anywhere in the script.  A label is defined by a single 
  1097. word preceded by a : as in:
  1098.  
  1099.      :label
  1100.  
  1101.      When the script encounters a GOTO command the next instruction 
  1102. processed will be the one after the label specified in the GOTO command.  
  1103. An example is:
  1104.  
  1105.      instruction 1
  1106.      instruction 2
  1107.      GOTO mylabel
  1108.      :anotherlabel
  1109.      instruction 3
  1110.      instruction 4
  1111.      ...
  1112.      :mylabel
  1113.      instruction 8
  1114.      ...
  1115.  
  1116. In this case after instruction 2 is completed, instruction 8 will be the 
  1117. next instruction executed.  Instructions 3 to :mylabel will be skipped.  
  1118. This may seem foolish but somewhere else in the script there would be a 
  1119. GOTO anotherlabel command so those instructions would be performed then.
  1120.  
  1121.      The above sequence would be used if a certain series of instructions 
  1122. were always to be performed, but in some cases additional instructions 
  1123. needed to be performed first.  This is one reason for the unconditional 
  1124. branch, to save duplication of steps.  In this case the unconditional 
  1125. branch is almost always paired with a conditional branch to determine if 
  1126. the condition for the additional steps was met.
  1127.  
  1128.       The CALL command temporarily redirects the sequence of steps to the 
  1129. location of the specified label.  The CALL command label must meet the 
  1130. same restrictions as the label used by the GOTO command.  There is a 
  1131. significant difference in the format of the CALL command steps.  The 
  1132. sequence of steps following the label called by the CALL command must end 
  1133. with the RETURN command as shown below.
  1134.  
  1135.      CALL mylabel
  1136.      instruction 3
  1137.      instruction 4
  1138.      GOTO anotherlabel
  1139.      :mylabel
  1140.      instruction 8
  1141.      instruction 9
  1142.      RETURN
  1143.  
  1144. In this case, the script would reach the CALL command, perform instruc-
  1145. tions 8 and 9, then return to perform instructions 3 and 4.
  1146.  
  1147.      Since the CALL command temporarily redirects the sequence of events, 
  1148. something must be done to prevent the script from performing the steps 
  1149. which should only be performed by the CALL command.  The above example 
  1150. showed a GOTO command which directed the sequence away from the CALL 
  1151. command steps.  Such a redirection is always needed to prevent a script 
  1152. error "RETURN without a CALL."  Generally all the CALL command steps are 
  1153. grouped at the end of the script so the GOTO command will redirect the 
  1154. script to the ENDSCRIPT command.
  1155.  
  1156.      The CALL command cannot call a label which is outside the script.  
  1157. Each script is defined as the commands between the SCRIPT # and ENDSCRIPT 
  1158. commands.
  1159.  
  1160.      The CALL command has many uses, all of which could generally be done 
  1161. by a conditional branch.  The operation of the specific script determines 
  1162. if the CALL command has advantages over the conditional branch or not.  
  1163. The first case of advantage is if the same steps need to be performed 
  1164. under different conditions.  In this case the CALL command will prevent 
  1165. duplicating the steps for each condition where the steps need to be 
  1166. performed.  The second case of advantage is if the same steps need to be 
  1167. performed in a different sequence under different conditions.  In this 
  1168. case the steps can be broken down into groups of consistent steps and the 
  1169. sequence determined by the order each group is called by the CALL 
  1170. commands.  This may require an example.
  1171.  
  1172.      IF STRING 1 IS "action 1"
  1173.        CALL block1
  1174.        CALL block2
  1175.        CALL block3
  1176.      ENDIF
  1177.      IF STRING 1 IS "action 2"
  1178.        CALL block3
  1179.        CALL block1
  1180.        CALL block2
  1181.      ENDIF
  1182.  
  1183. The blocks could be any set of instructions which need to be performed in 
  1184. a different order depending on what action is to be performed.  An 
  1185. example might be the order bulletin boards are accessed while on GEnie.
  1186.  
  1187.      The last advantage I will mention is one of simplicity for modifica-
  1188. tion.  If a conditional branch requires many steps be performed, it is 
  1189. much easier to follow the flow of steps using a CALL command from the 
  1190. conditional branch than to include all the steps in the conditional 
  1191. branch.
  1192.  
  1193.      I won't provide an example for all the advantages of using the CALL 
  1194. command, but if you are really interested, take a look at my Multiple 
  1195. Scripts script in the ST Aladdin RT library.  It uses the CALL command to 
  1196. allow a single script to use many other scripts.
  1197.  
  1198.      Before providing the promised modification to the Read Messages 
  1199. script, let me provide some guidance on labels.
  1200.  
  1201.      Labels can be more than one word.  It can be an entire sentence if 
  1202. desired and the script will not show any errors.  However, only the first 
  1203. word is used to find the label.  A word is defined by the characters 
  1204. between the : and the first space or carriage return.  Thus if more than a 
  1205. single word is used for a label care must be used to prevent confusion 
  1206. when debugging the script.  Labels are not case sensitive so :MYlable is 
  1207. the same as :mylabel.  Below are some examples of labels and what would
  1208. be used by the script.
  1209.  
  1210.      LABEL                                        SCRIPT USE
  1211.  
  1212.      Go here when true                            Go
  1213.  
  1214.      Go here when false                           Go
  1215.  
  1216.      Go_here when true                            Go_here
  1217.  
  1218.      As you can see from the above examples.  If the first and second 
  1219. examples were used in the same script the script would always go to the 
  1220. first Go encountered.  This could cause some real confusion when trying 
  1221. to determine why things weren't working as planned.  Be sure your labels 
  1222. are unique.  The script language doesn't check to be sure each label is 
  1223. unique.
  1224.  
  1225.      Next time we will look at the file commands available in ST Aladdin 
  1226. scripts.  Some of these will allow us to have the script start and end 
  1227. the capture file for us when capturing messages.
  1228.  
  1229.      Now for the modified Read Messages script using unconditional 
  1230. branches.  By using the GOTO command we can eliminate the nested 
  1231. conditional branches making the script easier to modify.  Any number of 
  1232. menu options can now be easily added by simply adding more conditional 
  1233. branches before the enter page number section of the script.  The 
  1234. execution of the script is unchanged, but modification is greatly 
  1235. simplified.
  1236.  
  1237.      To show how the CALL command might be used we will add the steps 
  1238. necessary to display which bulletin board was selected.  This use of the 
  1239. call commands doesn't save any steps but it does provide a working 
  1240. example.
  1241.  
  1242.  
  1243. SCRIPT 3 Read Messages
  1244. ECHO OFF                           Don't display script commands
  1245. CLEAR                              Clear the screen
  1246. NOTE
  1247. NOTE "This script will retrieve messages from a GEnie bulletin board"
  1248. NOTE "starting at the specified date.  Messages from all categories not"
  1249. NOTE "permanently ignored will be retrieved."
  1250. NOTE
  1251. NOTE "Be sure to start a capture file before running this script."
  1252. NOTE
  1253. NOTE "       Bulletin boards available"
  1254. NOTE
  1255. NOTE "       1  ST Aladdin bulletin board"
  1256. NOTE "       2  Atari ST RT bulletin board"
  1257. NOTE
  1258. NOTE "Enter the menu number of the bulletin board."
  1259. NOTE "Press RETURN with no number to enter a BB page number."
  1260. NOTE "Press ESC at any time to abort the script."
  1261. NOTE
  1262. NOTE "       Menu Selection:"
  1263. GETSTRING 1
  1264. IF SUCCESS                         ESC not pressed
  1265. IF STRING 1 IS "1"                 ST Aladdin BB selected
  1266.   SETSTRING 1 "1000"               ST Aladdin BB page
  1267.   SETSTRING 3 "ST Aladdin"         Name of BB selected
  1268.   CALL Show_BB                     Show which BB was selected
  1269.   GOTO Enter_date                  Get the date to check
  1270. ENDIF                         
  1271. IF STRING 1 IS "2"                 Atari ST BB selected
  1272.   SETSTRING 1 "475"                Atari ST BB page
  1273.   SETSTRING 3 "Atari ST"           Name of BB selected
  1274.   CALL Show_BB                     Show which BB was selected
  1275.   GOTO Enter_date                  Get the date to check
  1276. ENDIF
  1277. NOTE
  1278. NOTE "Enter the page number for the bulletin board to check."
  1279. GETSTRING 1
  1280. :Enter_date                        Enter the date to check
  1281. NOTE "Enter the date to start reading messages as YYMMDD.(Year Month Day)"
  1282. GETSTRING 2
  1283. IF SUCCESS
  1284. LOG ONTO "%1;1"
  1285. SENDLINE "REA ALL ALL CAT=1-1000 DATE>%2 NOR"
  1286. WAITFORPROMPT
  1287. GOTO End                           Go to the end of the script
  1288. :Show_BB                           Show which BB was selected
  1289.   NOTE "The %3 Bulletin Board was selected."
  1290. RETURN 
  1291. :End
  1292. LOG OFF
  1293. ENDIF
  1294. ENDSCRIPT
  1295.  
  1296.  
  1297.  
  1298.  
  1299. CHAPTER 6
  1300. """""""""
  1301.     [PT6]
  1302.  
  1303.                          >>> FILE COMMANDS <<<
  1304.                          """""""""""""""""""""
  1305.  
  1306.      This week we will take a look at the commands in ST Aladdin which 
  1307. deal with disk files.  There are only four commands and they are easy to 
  1308. work with.
  1309.  
  1310.      The most frequently used file commands are the CAPTURE and  
  1311. ENDCAPTURE commands.  These commands will start and end a file capture of 
  1312. the on-line session.  The format is:
  1313.  
  1314.      CAPTURE "filename"
  1315.      ENDCAPTURE
  1316.  
  1317.      A file capture will copy all text displayed on the screen to the  
  1318. specified file.  This allows saving information for later reference  
  1319. without having to retrieve it again.  This is what happens when you do a  
  1320. browse of library files.  The descriptions are saved to a file for later  
  1321. display.
  1322.  
  1323.      The CAPTURE command accomplishes the same action as the Start Text  
  1324. Capture option under the Terminal menu.  The difference is the CAPTURE  
  1325. command must provide the file path and name to use, since no Item  
  1326. Selector box is provided for selection as with the Start Text Capture  
  1327. menu option.
  1328.     
  1329.      Since the CAPTURE command performs the same operation as the Start  
  1330. Text Capture Terminal menu option, they cannot both be active at the same 
  1331. time.  This means a CAPTURE command in a script will stop a capture 
  1332. started by the Terminal menu option.  Once the capture is stopped, it will
  1333. not be resumed when the script capture is stopped.
  1334.  
  1335.      The ENDCAPTURE command accomplishes the same action as the End Text  
  1336. Capture option under the Terminal menu.  This command will stop the  
  1337. capture of on-line information and save the file to disk.
  1338.   
  1339.      It is important to always stop a file capture before exiting  
  1340. Aladdin.  Only part of the file may be saved if the capture is not ended  
  1341. before exiting.  The capture can be stopped after logging off GEnie, but  
  1342. it should be ended to allow saving the entire file.  Use of the End Text 
  1343. Capture option will stop a capture, that was started by a script CAPTURE  
  1344. command if the ENDCAPTURE command was not used.
  1345.  
  1346.      The CAPTURE command will append a file to an existing file if the  
  1347. same name is used.  This allows saving information in the same file for  
  1348. easy reference.  It also prevents accidentally overwriting a file with a  
  1349. script CAPTURE command.  If it ever seems like the CAPTURE command  didn't 
  1350. work, be sure to check the end of the captured file for the information.  
  1351. It may have been added to a file which already existed.
  1352.  
  1353.      The CAPTURE command will create a new file if the name doesn't  
  1354. exist, but it will not create a new folder.  If the specified path does  
  1355. not exist, the capture will not be saved, and no script error will  occur.
  1356.  
  1357.      ST Aladdin provides the IF SUCCESS command which should determine if 
  1358. the capture was opened successfully or not.  This command was discussed 
  1359. in part 4 of the scripts articles.  If the capture file was opened 
  1360. successfully, the SUCCESS flag should be set to true, so the IF SUCCESS 
  1361. command should show true and be executed.  If the capture file was not 
  1362. opened, the SUCCESS flag should be set to false, so the IF SUCCESS 
  1363. command will show false and not be executed.  This does not work properly 
  1364. in version 1.23 of ST Aladdin.  The IF SUCCESS command always shows TRUE, 
  1365. even if the CAPTURE command failed to open the file.
  1366.  
  1367.      Another file command provides a work around to check if the CAPTURE  
  1368. command was able to open the specified file.  The IF EXIST command will  
  1369. check if the specified file exists.  The format is:
  1370.  
  1371.     IF EXIST "file to check for"
  1372.  
  1373. it can be used just like any other IF statement in the script language.
  1374.  
  1375.      By using the IF EXIST command with the same path and file name as  
  1376. the CAPTURE command, the script can determine if the specified file was  
  1377. created.  If it exists, the capture should work, if it doesn't, it won't  
  1378. work for sure.  An example is shown below:
  1379.  
  1380.     CAPTURE "E:\GENIE\FILE.TXT"        start capture. 
  1381.     IF EXIST "E:\GENIE\FILE.TXT"       does the file exist? 
  1382.        NOTE "Capture begun"            note not necessary. 
  1383.     ELSE                               file doesn't exist. 
  1384.        NOTE "file not opened, aborting." 
  1385.        GOTO END                        abort script 
  1386.     ENDIF 
  1387.     ;the rest of the script 
  1388.     :END                               go here to abort 
  1389.     ENDSCRIPT
  1390.  
  1391.      The last file command is the ERASEFILE command.  This command will  
  1392. erase (delete) a file from the disk.  If the specified file was found and 
  1393. erased, the SUCCESS flag is set to TRUE and if not, to FALSE.  This can 
  1394. be used with the IF SUCCESS command to determine if the file was erased.  
  1395. An example of the ERASEFILE command is provided below:
  1396.     
  1397.      ERASEFILE "E:\GENIE\FILE.TXT"
  1398.  
  1399. If the ERASEFILE command does not find the file, no script error will  
  1400. occur.
  1401.  
  1402.      All the commands which require specifying a file can use a string  
  1403. variable for the specification.  Examples are provided below for the file 
  1404. being specified in string variable 2.
  1405.  
  1406.     CAPTURE %2
  1407.     IF EXIST %2
  1408.     ERASEFILE %2
  1409.  
  1410.      That wraps up the ST Aladdin script commands dealing with disk  
  1411. files.  Next time we'll take a look at some miscellaneous commands which  
  1412. can add some special features to scripts.
  1413.  
  1414.      Now we'll use some of the commands to allow the script to open and  
  1415. close the capture file in our read messages script.  We could allow  
  1416. entering a file name each time the script is run, but this time we will  
  1417. set a permanent file name which will be appended when new messages are  
  1418. read.
  1419.  
  1420. SCRIPT 3 Read Messages 
  1421. ECHO OFF                           Don't display script commands 
  1422. CLEAR                              Clear the screen 
  1423. NOTE 
  1424. NOTE "This script will retrieve messages from a GEnie bulletin board" 
  1425. NOTE "starting at the specified date.  Messages from all categories not" 
  1426. NOTE "permanently ignored will be retrieved." 
  1427. NOTE 
  1428. NOTE "Messages will be saved to the file named MESSAGES.TXT in the same" 
  1429. NOTE "folder as the Aladdin program." 
  1430. NOTE 
  1431. NOTE "       Bulletin boards available" 
  1432. NOTE 
  1433. NOTE "       1  ST Aladdin bulletin board" 
  1434. NOTE "       2  Atari ST RT bulletin board" 
  1435. NOTE 
  1436. NOTE "Enter the menu number of the bulletin board." 
  1437. NOTE "Press RETURN with no number to enter a BB page number." 
  1438. NOTE "Press ESC at any time to abort the script." 
  1439. NOTE 
  1440. NOTE "       Menu Selection:" 
  1441. GETSTRING 1 
  1442. IF SUCCESS                         ESC not pressed 
  1443.  IF STRING 1 IS "1"                ST Aladdin BB selected 
  1444.   SETSTRING 1 "1000"               ST Aladdin BB page 
  1445.   SETSTRING 3 "ST Aladdin"         Name of BB selected 
  1446.   CALL Show_BB                     Show which BB was selected 
  1447.   GOTO Enter_date                  Get the date to check 
  1448.  ENDIF                          
  1449.  IF STRING 1 IS "2"                Atari ST BB selected 
  1450.   SETSTRING 1 "475"                Atari ST BB page 
  1451.   SETSTRING 3 "Atari ST"           Name of BB selected 
  1452.   CALL Show_BB                     Show which BB was selected 
  1453.   GOTO Enter_date                  Get the date to check 
  1454.  ENDIF 
  1455.  NOTE 
  1456.  NOTE "Enter the page number for the bulletin board to check." 
  1457.  GETSTRING 1 
  1458.  :Enter_date                       Enter the date to check 
  1459.  NOTE"Enter the date to start reading messages as YYMMDD.(Year Month Day)"
  1460.  GETSTRING 2  
  1461.  IF SUCCESS  
  1462.   LOG ONTO "%1;1"  
  1463.   CAPTURE "MESSAGES.TXT"           Open capture file  
  1464.   IF EXIST "MESSAGES.TXT"          The file was opened 
  1465.    NOTE " "                        Move to next line 
  1466.    NOTE "Capture started."         Display message 
  1467.   ELSE                             File not opened 
  1468.    NOTE "Capture file not opened, aborting" 
  1469.    GOTO End                        abort the script 
  1470.   ENDIF 
  1471.  SENDLINE "REA ALL ALL CAT=1-1000 DATE>%2 NOR" 
  1472.  WAITFORPROMPT 
  1473.  ENDCAPTURE                        Close the capture file 
  1474.  GOTO End                          Go to the end of the script 
  1475.  :Show_BB                          Show which BB was selected 
  1476.  NOTE "The %3 Bulletin Board was selected." 
  1477.  RETURN  
  1478.  :End 
  1479.  LOG OFF 
  1480. ENDIF 
  1481. ENDSCRIPT 
  1482.  
  1483.  
  1484.  
  1485.  
  1486. CHAPTER 7
  1487. """""""""
  1488.     [PT7]
  1489.  
  1490.  
  1491.               >>> OTHER COMMANDS IN ST ALADDIN SCRIPTS <<<
  1492.               """"""""""""""""""""""""""""""""""""""""""""
  1493.  
  1494.      As I promised last time, this article will take a look at some  
  1495. miscellaneous commands which add special features to ST Aladdin Scripts.
  1496.     
  1497.      The BEEP and ALARM commands allow the script to notify the user at a 
  1498. particular time.  Both of these commands produce a beep from the computer 
  1499. speaker (sounds like a bell to me).  The BEEP command will sound a single 
  1500. beep and then the script will proceed.  This is the same sound that 
  1501. occurs when you enter Basic*Services on GEnie.  The ALARM will make the 
  1502. same sound as BEEP, but the beeping will continue until ESC is pressed.  
  1503. An Alert box is displayed with the message Press ESC...  The script will 
  1504. stop until the alarm is silenced.
  1505.  
  1506.     The format of the BEEP and ALARM commands are:
  1507.  
  1508.     BEEP
  1509.     ALARM
  1510.  
  1511. no other information is required.
  1512.  
  1513.     The GETKEY command will stop the script until a key is pressed.  The 
  1514. key is stored in the specified variable as in:
  1515.  
  1516.     GETKEY 1
  1517.  
  1518.     In this case the key pressed is stored in string variable 1.  This is 
  1519. a good way to retrieve a single value for menu selection.  No RETURN is  
  1520. required.  This is also a good substitute for the GETKEYPRESS command  
  1521. which is designed to stop the script until a key is pressed, but doesn't  
  1522. work.
  1523.  
  1524.     The HANGUP command will immediately hangup the modem using the stored 
  1525. hangup string in ST Aladdin.  It is cleaner to use the LOG OFF command 
  1526. when finished with a script, but if you think the script could get stuck 
  1527. and want to be sure the script disconnects the GEnie session, HANGUP will 
  1528. do the same thing as turning off your modem while connected to GEnie.
  1529.  
  1530.     The HIDE command will prevent the transmitted characters from being  
  1531. displayed on the screen.  This is what happens when your account number  
  1532. and password are sent to GEnie after the U# prompt is received.  Any time 
  1533. you want to send something to GEnie, you don't want the script to display 
  1534. on the screen, use the HIDE command.  The hide feature must be turned ON 
  1535. and OFF when done as in:
  1536.  
  1537.     HIDE ON 
  1538.     SEND "my account number and password" 
  1539.     HIDE OFF
  1540.  
  1541.     You can have your script check if you are already logged onto GEnie  
  1542. with the ONLINE command.  It is used in an IF statement to determine if  
  1543. the modem Carrier Detect (CD) line is on.  If the modem is connected the  
  1544. IF ONLINE command will evaluate as true allowing the if conditions to be  
  1545. executed.  The format is:
  1546.  
  1547.     IF ONLINE 
  1548.     these commands will be executed 
  1549.     ELSE 
  1550.     these commands will be executed 
  1551.     ENDIF
  1552.  
  1553.     The PAUSE command halts the script for the specified number of  
  1554. seconds.  Sometimes GEnie takes some time before the next command can be  
  1555. executed.  This is generally handled by the WAITFOR and WAITFORPROMPT  
  1556. commands which were discussed in previous articles.  There are a few  
  1557. circumstances where no prompt is provided before the next information is  
  1558. needed.  In these cases the script must be able to delay for a specified  
  1559. time.  The PAUSE command will provide the required delay.  The PAUSE  
  1560. command works with full or fractions of seconds.  The format is:
  1561.  
  1562.     PAUSE 30.5
  1563.  
  1564. This will halt script operation for 30 and one half seconds.
  1565.  
  1566.     Another command which will delay script operation until a specified  
  1567. time is the WAITUNTIL command.  This command will halt script operations  
  1568. until the specified clock time is reached.  The time is specified in the  
  1569. 24 hour format so 1:00 pm is 13:00.  An example is:
  1570.  
  1571.     WAITUNTIL 13:00
  1572.  
  1573. which will halt the script until 1:00 pm.  An Alert box is displayed with 
  1574. the message Waiting until 13:00, pressing ESC will abort the script.
  1575.  
  1576.     The WAITUNTIL command is useful for allowing a script start at a  
  1577. specified time.  Since the script uses the computer clock to know when  
  1578. the time is reached, the computer clock must be set correctly for proper  
  1579. operation.
  1580.  
  1581.     The PERFORM command allows one script to run another script.  This  
  1582. command can run any script except the one it is called from, including  
  1583. script 1 (AutoPass 1) and script 2 (AutoPass 2).  When the script  
  1584. encounters the PERFORM command, it will jump to the specified script,  
  1585. accomplish its operation, excluding any LOG OFF commands, and return to  
  1586. the current script.  With the PERFORM command and the WAITUNTIL command,  
  1587. you could have the computer perform AutoPass 1 during the night or early  
  1588. morning so it is ready for review when you get up.  A simple script looks 
  1589. like this:
  1590.  
  1591.     SCRIPT 3 Timed AutoPass 1 
  1592.     ECHO OFF                           Don't show commands 
  1593.     CLEAR                              Clear the screen 
  1594.     NOTE "Enter the time to perform AutoPass 1 as HH:MM." 
  1595.     NOTE "Use 24 hour clock.  Insure Computer clock is correct." 
  1596.     NOTE "Press ESC to abort script." 
  1597.     GETSTRING 1                        Time to do AutoPass 1 
  1598.     WAITUNTIL %1                       Wait for time 
  1599.     PERFORM 1                          Do AutoPass 1 
  1600.     LOG OFF                            log off GEnie when done 
  1601.     ENDSCRIPT
  1602.  
  1603.     Some people are a little nervous letting the computer log onto GEnie 
  1604. while they are not watching, just in case something goes wrong and the 
  1605. dollars keep mounting.  Aladdin should log off when the timeout time  
  1606. elapses providing a second safeguard, but you have to decide if you are  
  1607. willing to try a timed script.  Personally I watch.
  1608.  
  1609.     The last script commands I will address are the XMODEM and ZMODEM  
  1610. commands.  The XMODEM command can be used for both upload and download  
  1611. operations.  ZMODEM can only be used for downloading since GEnie does not 
  1612. support ZMODEM uploads.  The command formats are:
  1613.  
  1614.     XMODEM UPLOAD "E:\GENIE\FOLDER1\MYFILE.ARC"
  1615.     XMODEM DOWNLOAD "E:\GENIE\FOLDER1\MYFILE.ARC"
  1616.     ZMODEM 
  1617.     ZMODEM "E:\GENIE\FOLDER1\"
  1618.  
  1619.     The XMODEM direction must be specified since both uploads and  
  1620. downloads are possible.  Since XMODEM does not pass a file name one must  
  1621. be specified for each file.  ZMODEM will pass the file name, so only a  
  1622. path is needed.  If no path is specified for either XMODEM or ZMODEM the  
  1623. files will be placed in the same folder as the Aladdin program.
  1624.  
  1625.     ZMODEM is automatic with ST Aladdin, so the ZMODEM command without a 
  1626. path is not required.  When Aladdin recognizes a ZMODEM download has  
  1627. started, it will automatically begin the ZMODEM capture.  If a path was  
  1628. specified with the ZMODEM command, the files will be placed into the  
  1629. specified path, if no ZMODEM command was used or no path specified, the  
  1630. files will be placed in the same folder as the Aladdin program.
  1631.  
  1632.     This ends the Intro to Scripts series.  St Aladdin has more script  
  1633. commands than this series has mentioned, so be sure to check the manual  
  1634. if you want to do something that wasn't covered. 
  1635.  
  1636.  
  1637.  
  1638.  
  1639. CHAPTER 8
  1640. """""""""
  1641.     [PT8]
  1642.  
  1643.  
  1644.                  >>> INTRO TO SCRIPTS, INTERRUPTED <<<
  1645.                  """"""""""""""""""""""""""""""""""""" 
  1646.                         (Too good to believe? :-)
  1647.  
  1648. NOTE: The following article was my idea of the perfect script language.
  1649. """"  The article was reprinted in the April Fools issue of GEnie Lamp 
  1650. on April 1st 1991.
  1651.  
  1652.      I am going to interrupt my normal sequence of articles on writing 
  1653. scripts for ST Aladdin 1.2 for some great news for script writers and 
  1654. users.  The next article will continue with the current script 
  1655. capabilities of ST Aladdin.
  1656.  
  1657.      Since I have been experimenting with ST Aladdin scripts and writing 
  1658. more than a few scripts, Gordon and Tim were gracious enough to allow me 
  1659. to take a look at what scripts will look like in the future ST Aladdin. I 
  1660. hesitate to provide this look since it may discourage people from writing 
  1661. scripts for ST Aladdin 1.2 but decided this was just too good to pass up.
  1662.  
  1663.      First let me tell you this will not be available in the near future.  
  1664. Lots of smaller changes to be worked on in ST Aladdin before the time can 
  1665. be expended to fully debug this new script language, but it will knock 
  1666. your socks off when you get it!  (Please don't bug Gordon and Tim about 
  1667. this.  They didn't want me to say anything, you know, something about not 
  1668. releasing features until they are ready to be distributed, and all that 
  1669. stuff.  But, being the person I am, I just couldn't pass this up.  
  1670. Please, Gordon and Tim, don't hold this against me.  I promise next time I 
  1671. won't tell a soul.)
  1672.  
  1673.      This new and improved script language is designed with the user in 
  1674. mind.  Not only does it not take programming experience to use, it is so 
  1675. easy to use, if you can log onto GEnie with ST Aladdin, you can create 
  1676. your own custom script.  Sound hard to believe, just wait.
  1677.  
  1678.      There are over two hundred fifty commands which the new script 
  1679. language understands.  This may sound a little daunting at first, but it 
  1680. is no problem, mainly because you don't have to remember them to write a 
  1681. script.  In fact, you might not ever have to type a single script command.  
  1682. That's right, you can create an entire script without typing a single 
  1683. script command.
  1684.  
  1685.      I know what you are thinking, here is another auto script program 
  1686. which will record what I manually do and then play it back.  Well, you are 
  1687. partially right.  Scripter (my name, the official one remains to be 
  1688. released) will record all your online actions and play them back at a 
  1689. later time, but it can do much more.
  1690.  
  1691.      When Scripter is run from the ST Aladdin terminal menu there are two 
  1692. choices, RECORD user script or PLAY user script.  If no scripts are 
  1693. available RECORD is the only option selectable, PLAY is grayed out.
  1694.  
  1695.      GEnie will have a new file available for use with Scripter.  In that 
  1696. file are all the menu screens available on GEnie.  The version I got to 
  1697. see only had the thirty most popular pages, but it was enough to see how 
  1698. things will work.
  1699.  
  1700.      Let's take a look at what a typical recording session with Scripter 
  1701. will be like.  When RECORD is selected Scripter looks for the menu file. 
  1702. If the file is not found you have the option to log onto GEnie or abort 
  1703. the recording session.  If log onto GEnie is selected, an item selector is 
  1704. presented to enter the script name and Aladdin logs onto GEnie using your 
  1705. user ID and password.  Scripter stops at the GEnie opening screen where
  1706. you can manually navigate through the desired actions.  At any time you
  1707. can select stop and Scripter will stop recording your actions and save
  1708. the script file.  The script will automatically stop when you log off
  1709. GEnie during the recording session.  The script can be played to 
  1710. accomplish the exact actions you just recorded.  If you want to make 
  1711. different choices during script playback, you need to modify the script 
  1712. placing variables where the desired choices were made.
  1713.  
  1714.      The really nice features of Scripter show up when the GEnie menu file 
  1715. is available.  If the menu is available when RECORD is selected things 
  1716. seem to proceed as before but there are a few major changes. Instead of 
  1717. logging onto GEnie, the menu screens are presented off line. All the menu 
  1718. choices can be selected, but of course no data is shown. All desired 
  1719. selections can be recorded for execution during script playback.  This is 
  1720. the same as manual recording, but you are off line, so no charges are 
  1721. accumulating the entire time you are creating the script.  The real 
  1722. advantage comes when you reach a menu choice or entry request which you 
  1723. wish to set-up as a variable.  Instead of having to go back and modify the 
  1724. recorded script, just press the ? and a variable will be assigned to that 
  1725. selection.  If you want to specify some text to be displayed when the 
  1726. variable value is requested, all you need do is press ALT T.  A dialog box 
  1727. appears where up to three lines of 75  characters each can be entered.  
  1728. Again the script can be stopped at any time by selecting STOP or pressing 
  1729. ALT S.  It is automatically stopped when LOG OFF is selected.
  1730.  
  1731.      After a session is recorded it can be played back whenever you want 
  1732. to accomplish the script actions.  If the script has no variables it will 
  1733. proceed from start to finish with no interaction required.  If a capture 
  1734. was used during the original recording, the same file name will be used 
  1735. and the information appended if the file already exists.  If any variables 
  1736. were used in the script, the script will display the menu selection line 
  1737. or the entered text requesting the variable value.  Once all variable 
  1738. values have been entered, the script will log onto GEnie and accomplish 
  1739. all actions.
  1740.  
  1741.      As if this isn't enough, there is more.  Any script can call any 
  1742. other script.  This means if during a recording session, you decide you 
  1743. want to perform a previously recorded script, it can be done.  While 
  1744. recording, just press the ALT I key to include another script.  An item 
  1745. selector will be displayed to select the desired script.  There are some 
  1746. precautions here.  The script being recorded must be at a prompt where the 
  1747. included script can legally start and the included script must end at a 
  1748. place where the new script can begin again.  This is not a problem if the 
  1749. included script was recorded all the way through log off since start and 
  1750. stop occur at a page menu.
  1751.  
  1752.      Including scripts works with either Scripter mode, that is, with 
  1753. manual recording or with the GEnie menu file.  The difference is if you 
  1754. are in the manual record mode, the included script will be executed 
  1755. immediately, where in the menu record mode, the script will just be 
  1756. inserted in the proper place, and only played when the recorded script is 
  1757. played.  If the inserted script ended with a LOG OFF, it will not log off 
  1758. GEnie, just return to the recorded script.  The one hazard to inserting 
  1759. scripts in the GEnie menu mode is you don't know where the inserted 
  1760. script will end.  If it was stopped before the LOG OFF command, it may not 
  1761. be at a page menu, which could cause problems.  I have suggested the 
  1762. inserted script display the final menu item where it stops to prevent any 
  1763. confusion when using the GEnie menu mode.
  1764.  
  1765.      One of the nice features of the insert script command is it allows 
  1766. creating custom script sequences.  Select RECORD user script and then just 
  1767. start inserting the desired scripts.  When all scripts have been inserted, 
  1768. select LOG OFF and the script is ready to go.  With this feature you can 
  1769. even use the same script multiple times allowing you to essentially create 
  1770. your own AutoPass 1 script.
  1771.  
  1772.      If it weren't for the intelligent way Scripter uses variables 
  1773. multiple scripts could cause a serious conflict.  Since Scripter assigns 
  1774. variables as they are encountered in the script, multiple scripts are no 
  1775. problem.  As the script is executed, each variable is assigned a 
  1776. sequential number which will be used to match the value with the proper 
  1777. script location.  It is even possible to have the same value entered 
  1778. multiple places in the script.  This is accomplished by pressing ALT D. 
  1779. This displays a list of variables already used in the script, from which 
  1780. one may be selected to fill the required place.  There is even a 
  1781. capability to select any of the configuration variables, such as user ID 
  1782. or BB page number, as well as set up a table of default values to use for 
  1783. variables.  Scripter has the most flexible use of variables in any script 
  1784. language I have seen.
  1785.  
  1786.      Scripter has a built in time feature which will allow starting a 
  1787. script at a specified time or with a specified delay.  When a script is 
  1788. placed into a delayed start, you are returned to ST Aladdin to perform 
  1789. other operations.  As long as you don't leave ST Aladdin the script will 
  1790. be performed when the time arrives.  The only precaution is to not be 
  1791. doing one script or manual action on GEnie when the time for the script 
  1792. arrives, because it will begin when it should.  A feature which asks if 
  1793. the timed script should start, wait until you are finished, or abort would 
  1794. be nice.  Perhaps this will be added to the final version, after all this 
  1795. is only a beginning, but what a beginning.
  1796.  
  1797.      You will notice I haven't mentioned anything about keyboard commands.
  1798. All scripts can be written without knowing about the syntax of the
  1799. language, sequence of events required, string handling or any of those
  1800. things.  If you are really determined to make script writing hard, you can
  1801. do all script writing manually with the 250 plus commands.  I don't know
  1802. why you would want to do this, but the capability is still there. Oh by
  1803. the way, did I mention the number of scripts is limited only by disk
  1804. space.  Since each script is assigned its own file name, and loaded from
  1805. an item selector, you can place scripts anywhere you choose and have as
  1806. many as your disk will hold.  And for floppy drive users, scripts can be
  1807. stored any where the item selector can find them, which includes floppy
  1808. disks.  The only problem with floppy drives is if the disk isn't in place
  1809. when the script is run, things will come to a screeching halt.
  1810.  
  1811.      There might be other features added before the general public sees 
  1812. Scripter, although I can't imagine what.  Voice recognition?  For those 
  1813. who have been waiting to write their own scripts once Scripter is released 
  1814. you will have to wait no longer.  This has to be the easiest script writer 
  1815. I have ever seen.  The only thing which could be easier would be to have 
  1816. someone else know exactly what you wanted and do it for you, but then what 
  1817. personal satisfaction could be gained from that?
  1818.  
  1819.      Now if I could only get ............... ring ring ring ring.  What?  
  1820. What time is it?  4:00?  This can't be a dream! :-)
  1821.  
  1822.  
  1823.  
  1824.  
  1825. Chapter 9
  1826. """""""""
  1827.     [PT9]
  1828.  
  1829.  
  1830.                  >>> SUMMARY OF COMMANDS MENTIONED <<<
  1831.                  """""""""""""""""""""""""""""""""""""
  1832.                  ~ ST Aladdin V 1.2a Script Commands ~
  1833.  
  1834.      This is not a complete list of ST Aladdin script commands.  It is a 
  1835. summary of the commands mentioned in the above articles.  Look at the 
  1836. above examples or scripts on GEnie for specific application.
  1837.  
  1838.  
  1839. ALARM          Sounds a beep sound and displays an Alert Box message
  1840.                Press ESC...
  1841.                
  1842.                Format:   ALARM
  1843.  
  1844.                Script will stop and beeping will continue until ESC is 
  1845.                pressed.
  1846.  
  1847. BEEP           Sounds a single beep sound then script continues
  1848.  
  1849.                Format:   BEEP
  1850.                               
  1851.                This is the same sound that occurs when you enter
  1852.                Basic*Services on GEnie.  ALARM and BEEP make the same
  1853.                sound.
  1854.  
  1855. CALL           Temporarily redirects the sequence of steps to the location
  1856.                of the specified label.
  1857.  
  1858.                Format:   CALL label
  1859.  
  1860.                The sequence of steps following the label called by the 
  1861.                CALL command must end with the RETURN command as shown 
  1862.                below.
  1863.  
  1864.                CALL mylabel
  1865.                ...
  1866.  
  1867.                :mylabel
  1868.                ...
  1869.  
  1870.                RETURN
  1871.  
  1872. CAPTURE        Starts capturing all text displayed on the screen to the 
  1873.                specified file.
  1874.  
  1875.                Format:   CAPTURE "filename"
  1876.  
  1877.                This accomplishes the same thing as the Start Capture 
  1878.                selection under the dropdown menu.
  1879.  
  1880. CLEAR          Clears the terminal screen.
  1881.  
  1882.                Format:   CLEAR
  1883.  
  1884.                This command just clears the computer screen and has no 
  1885.                effect on the connection to GEnie.
  1886.  
  1887. CURRENTLINEHAS Determines if the current line being received contains the 
  1888.                specified string.  Used with IF command.
  1889.  
  1890.                Format:   IF CURRENTLINE HAS "string"
  1891.                          ...
  1892.  
  1893.                          ELSE
  1894.                          ...
  1895.  
  1896.                          ENDIF
  1897.      
  1898.                The current line is ended by a carriage return.  
  1899.                The comparison is case sensitive, like the other string 
  1900.                comparisons so the string match must be exact.
  1901.  
  1902. delimiters     Mark the beginning and end of string variarbles.
  1903.  
  1904.                Format:   "string to mark"
  1905.  
  1906.                Any of the following may be used as delimiters:
  1907.  
  1908.                ( )  [ ]  { }  < >  ` '  " "
  1909.                
  1910.                Only the delimiters may not appear in the string.
  1911.  
  1912. ECHO           Determines if commands will be displayed on the screen or 
  1913.                not.
  1914.  
  1915.                Format:   ECHO state
  1916.  
  1917.                Where:    state is ON to display commands
  1918.                                   OFF to hide commands
  1919.  
  1920.                The default state is ON so commands will be displayed if 
  1921.                no ECHO command is included in the script.  The NOTE 
  1922.                command is never shown, only the string it is to display.
  1923.  
  1924. ELSE           Defines the steps to be performed when the IF portion of a 
  1925.                conditional branch is not true.
  1926.  
  1927.                Format:   IF
  1928.                          ...
  1929.  
  1930.                          ELSE
  1931.                          ...
  1932.                         
  1933.                          ENDIF
  1934.  
  1935.                ELSE is always optional in the IF conditional branch.
  1936.  
  1937. ENDCAPTURE     Stops the capture of text displayed on the screen.
  1938.  
  1939.                Format:   ENDCAPTURE
  1940.  
  1941.                This command accomplishes the same thing as Stop Text 
  1942.                Capture under the dropdown menus and will end a capture 
  1943.                started with CAPTURE command or the Start Text Capture
  1944.                dropdown menu selection.
  1945.  
  1946. ENDIF          Defines the end of the IF conditional branch.
  1947.  
  1948.                Format:   IF    or  IF
  1949.                          ...       ...
  1950.  
  1951.                          ELSE      ENDIF
  1952.                          ...
  1953.  
  1954.                          ENDIF
  1955.  
  1956.                ENDIF is always required to terminate an IF statement.
  1957.  
  1958. ENDSCRIPT      Indicates the end of the current script.
  1959.  
  1960.                Format:   ENDSCRIPT
  1961.  
  1962.                This command MUST be the last command in all scripts.
  1963.  
  1964. ERASEFILE      This command will erase (delete) a file from disk.
  1965.  
  1966.                Format:   ERASEFILE "E:\FOLDER\FILE.TXT"
  1967.  
  1968.                If the specified file is found and erased, the SUCCESS 
  1969.                flag is set to TRUE and if not, to FALSE.  This can be 
  1970.                used with the IF SUCCESS command to determine if the file 
  1971.                was erased.  
  1972.  
  1973.                If the ERASEFILE command does not find the file, no script 
  1974.                error will occur.
  1975.  
  1976. EXIST          This command will check if a file exists.
  1977.  
  1978.                Format:   IF EXIST "E:\FOLDER\FILE.TXT"
  1979.  
  1980.                If the specified file exists the next steps are executed 
  1981.                just like any other IF statement in the script language.
  1982.  
  1983. GETKEY         Stops the script until a key is pressed.
  1984.  
  1985.                Format:   GETKEY number
  1986.  
  1987.                Where:    number is the string variable number 0 to 9.
  1988.  
  1989.                The key pressed is stored in the specified variable.
  1990.                No RETURN key press is required.
  1991.  
  1992. GETSTRING      Allows entering the value of a string variable from the 
  1993.                keyboard.
  1994.  
  1995.                Format:   GETSTRING number
  1996.  
  1997.                Where:    number is the string variable number 0 to 9
  1998.  
  1999.                The entered string can be any characters including spaces.  
  2000.                The string can have 75 characters maximum and is terminated 
  2001.                by a carriage return.
  2002.  
  2003. GOTO           Causes the script to go to the specified label and not 
  2004.                return.
  2005.  
  2006.                Format:   GOTO label
  2007.  
  2008.                The label can be anywhere in the script.
  2009.  
  2010.                When the script encounters a GOTO command the next 
  2011.                instruction processed will be the one after the label 
  2012.                specified in the GOTO command.
  2013.  
  2014. HANGUP         The HANGUP command will immediately hangup the modem using 
  2015.                the stored hangup string in ST Aladdin.
  2016.  
  2017.                Format:   HANGUP
  2018.  
  2019.                HANGUP will do the same thing as turning off your modem 
  2020.                while connected to GEnie.
  2021.  
  2022.                It is cleaner to use the LOG OFF command.
  2023.  
  2024. HIDE           The HIDE command will prevent the transmitted characters 
  2025.                from being displayed on the screen.
  2026.  
  2027.                Format:   HIDE state
  2028.  
  2029.                Where:    state is ON    to hide characters
  2030.                                   OFF   to show characters
  2031.  
  2032.                Default is HIDE OFF.
  2033.  
  2034.                Any time you want to send something to GEnie, you don't 
  2035.                want to display on the screen use the HIDE command.
  2036.  
  2037. IF             Defines the beginning of the IF conditional branch.
  2038.  
  2039.                Format:   IF    or  IF
  2040.                          ...       ...
  2041.  
  2042.                          ELSE      ENDIF
  2043.                          ...
  2044.  
  2045.                          ENDIF
  2046.  
  2047.                IF is always required to start an IF statement.
  2048.  
  2049.                ELSE is optional for all IF statements.
  2050.  
  2051. label          A lable is defined by a single word preceded by a :
  2052.  
  2053.                Format:   :label
  2054.  
  2055.                A label is not case sensitive, ie. LABEL is the same as 
  2056.                label.  A label definition stops at the first space.
  2057.  
  2058. LOG OFF        Terminates the GEnie on-line session in an orderly 
  2059.                fashion.
  2060.  
  2061.                Format:   LOG OFF
  2062.  
  2063.                Will terminate the session using the GEnie BYE command.
  2064.                If STAY is selected on the ST Aladdin menu, the LOG OFF
  2065.                command will be ignored.  LOG OFF allows any automatic
  2066.                settings such as check mail to be accomplished before the
  2067.                session is terminated.
  2068.  
  2069. LOG ON         Logs onto GEnie stopping at the opening page prompt.
  2070.  
  2071.                Format:   LOG ON
  2072.  
  2073.                Most times the script needs to be a particular page to 
  2074.                accomplish its task, it saves time to use the LOG ONTO 
  2075.                command instead.
  2076.  
  2077. LOG ONTO       Enters GEnie at the specified page and menu option.
  2078.  
  2079.                Format:   LOG ONTO "page;option"
  2080.  
  2081.                Where: page is the desired page number
  2082.                       option is the desired menu option
  2083.  
  2084.                This will send the page;option command after successful log
  2085.                onto GEnie using the ST Aladdin log on configuration.
  2086.  
  2087. NOTE           Sends the specified characters to the screen.
  2088.  
  2089.                Format:   NOTE "string"
  2090.  
  2091.                           or
  2092.  
  2093.                          NOTE "%2"
  2094.  
  2095.                The string can be any characters including spaces.  
  2096.                This information is only sent to the screen and not to
  2097.                GEnie if logged on at the time.  
  2098.                A string variable may be used as shown above.
  2099.  
  2100. ONLINE         Checks if logged onto GEnie.
  2101.  
  2102.                Format:   IF ONLINE
  2103.                          ...
  2104.  
  2105.                          ELSE
  2106.                          ...
  2107.  
  2108.                          ENDIF
  2109.                
  2110.                Determines if the modem Carrier Detect (CD) line is on.
  2111.  
  2112. PAUSE          Halts the script for the specified number of seconds.
  2113.  
  2114.                Format:   PAUSE seconds
  2115.  
  2116.                Where:    seconds is the number of seconds to delay
  2117.  
  2118.                The PAUSE command works with full or fractions of seconds.
  2119.  
  2120. PERFORM        Runs one script from another.
  2121.  
  2122.                Format:   PERFORM number
  2123.  
  2124.                Where:    number is the script to run 1 to 9.
  2125.  
  2126.                This command can run any script except the one it is 
  2127.                called from, including 1 (AutoPass 1) and 2 (AutoPass 2).  
  2128.                All commands in the called script will be performed except 
  2129.                the LOG OFF Command.
  2130.  
  2131. RETURN         Ends the steps to be executed by the CALL command.
  2132.  
  2133.                Format:   :mylabel
  2134.                          ...
  2135.  
  2136.                          RETURN
  2137.  
  2138. SCRIPT         Indicates the beginning of a script.
  2139.  
  2140.                Format:   SCRIPT digit text
  2141.  
  2142.                Where digit the script number, 3 to 9.
  2143.                      text is the name of the script to be displayed in the
  2144.                      script menu. (20 characters max.)
  2145.  
  2146. SEND           Sends the specified character(s) with no carriage return.
  2147.  
  2148.                Format:   SEND "string"
  2149.  
  2150.                           or
  2151.  
  2152.                          SEND "%1"
  2153.  
  2154.                Where:    string is one or more characters including 
  2155.                          spaces or a string variable as above.
  2156.  
  2157. SENDLINE       Send the specified string with a carriage return.
  2158.  
  2159.                Format:   SENDLINE "string"
  2160.  
  2161.                             or
  2162.  
  2163.                          SENDLINE "%1"
  2164.  
  2165.                The string can be any combination of characters 
  2166.                including spaces.  A string variable can also be 
  2167.                used as shown above.
  2168.  
  2169. SETSTRING      Assigns a string of characters to a string variable.
  2170.  
  2171.                Format:   SETSTRING number "string"
  2172.  
  2173.                Where:    number is the string variable number 0 to 9.
  2174.  
  2175.                          string is any characters including spaces
  2176.                          75 characters maximum.
  2177.  
  2178.                This allows setting the characters which a string 
  2179.                variable will represent.
  2180.  
  2181. STRING         Condition which compares a variable with characters.
  2182.  
  2183.                Format:   IF STRING digit verb string
  2184.                          ...
  2185.  
  2186.                          ELSE
  2187.                          ...
  2188.  
  2189.                          ENDIF
  2190.  
  2191.                where:    digit is 0 to 9 representing the ten possible 
  2192.                          script variables. 
  2193.     
  2194.                          verb is either IS or HAS. 
  2195.      
  2196.                          IS  requires the variable match exactly,
  2197.                              including upper/lower case. 
  2198.  
  2199.                          HAS requires the variable contain the specified
  2200.                              string.
  2201.  
  2202.                          string is the characters to match enclosed by 
  2203.                          string delimiters. 
  2204.  
  2205.                          (delimiters show where a string starts and 
  2206.                          stops, ie. " ")
  2207.  
  2208. SUCCESS        Used in two forms:
  2209.  
  2210.                IF SUCCESS determines if the previous action was successful 
  2211.                or not.
  2212.  
  2213.                Format:   IF SUCCESS
  2214.                          ...
  2215.  
  2216.                          ELSE
  2217.                          ...
  2218.  
  2219.                          ENDIF
  2220.  
  2221.                If the instruction executed right before the IF SUCCESS 
  2222.                branch was successful (true), the branch will be taken, 
  2223.                if it was unsuccessful (false), it will be skipped.
  2224.     
  2225.                The success conditions which may be checked are:
  2226.  
  2227.                CAPTURE        - was the capture started? 
  2228.                ENDCAPTURE     - was the capture ended? 
  2229.                ERASEFILE      - was the file erased? 
  2230.                GETSTRING      - was a string entered? 
  2231.                LOG ON         - was log on successful? 
  2232.                LOG ONTO       - was the log onto successful? 
  2233.                SNAPSHOT       - was the screen snapshot accomplished? 
  2234.                WAITFOR        - was the specified string received? 
  2235.                WAITFORPROMPT  - was the prompt received? 
  2236.                WAITUNTIL      - was the specified time reached? 
  2237.                XMODEM         - was the XMODEM operation completed?
  2238.  
  2239.  
  2240.                SUCCESS sets the condition of the success flag checked by 
  2241.                the IF SUCCESS command.
  2242.  
  2243.                Format:   SUCCESS TRUE
  2244.  
  2245.                               or
  2246.  
  2247.                          SUCCESS FALSE
  2248.  
  2249. WAITFOR        Script will not proceed until the specified string 
  2250.                is received.
  2251.  
  2252.                Format:   WAITFOR "string"
  2253.  
  2254.                String is case sensitive and can be any combination of
  2255.                characters including spaces.  An exact match is required.
  2256.  
  2257. WAITFORPROMPT  The script will not proceed until the defined prompt is
  2258.                received.
  2259.  
  2260.                Format:   WAITFORPROMPT
  2261.  
  2262.                The ST Aladdin prompt and the GEnie prompt must be set to 
  2263.                the same for this command to work.  It not only waits for 
  2264.                the prompt, but also waits for no data to be sent.  Most 
  2265.                fool proof way to send commands at the proper time.
  2266.  
  2267. WAITUNTIL      Halts a script until the specified clock time is reached.
  2268.  
  2269.                Format:   WAITUNTIL 13:00
  2270.  
  2271.                The 24 hour clock is used so the above example would halt 
  2272.                the script until 1:00 pm.
  2273.  
  2274.                An alert box is displayed with the message Waiting until 
  2275.                13:00.
  2276.  
  2277.                Pressing ESC will abort the script.
  2278.  
  2279. XMODEM         Downloads or Uploads a file using xmodem protocol.
  2280.  
  2281.                Format:   XMODEM UPLOAD "E:\GENIE\FOLDER1\MYFILE.ARC"
  2282.  
  2283.                            or
  2284.  
  2285.                          XMODEM DOWNLOAD "E:\GENIE\FOLDER1\MYFILE.ARC"
  2286.  
  2287.                Direction of transfer must be specified with xmodem.
  2288.  
  2289.                A filename must be specified since xmodem protocol does 
  2290.                not provide one during the download.
  2291.  
  2292.                If no path is specified the files will be placed in the 
  2293.                same folder as the Aladdin program.
  2294.  
  2295. ZMODEM         Downloads one or more files using zmodem protocol.
  2296.  
  2297.                Format:   ZMODEM
  2298.  
  2299.                            or
  2300.  
  2301.                          ZMODEM "E:\GENIE\FOLDER1\"
  2302.  
  2303.                ZMODEM can only be used for downloading since GEnie does 
  2304.                not support ZMODEM uploads.
  2305.  
  2306.                ZMODEM will pass the file name, so only a path is needed.
  2307.  
  2308.                If no path is specified the files will be placed in the 
  2309.                same folder as the Aladdin program.
  2310.  
  2311.                ZMODEM is automatic with ST Aladdin, so the ZMODEM command 
  2312.                without a path is not required.
  2313.  
  2314.                Note the ending \ in the path since no filename is needed.
  2315.  
  2316.  
  2317.  
  2318.  
  2319. CHAPTER 10
  2320. """"""""""
  2321.     [PT10]
  2322.  
  2323.  
  2324.            >>> ST Aladdin V 1.2A Index of Script Commands <<<
  2325.            """"""""""""""""""""""""""""""""""""""""""""""""""    
  2326.  
  2327. Command             Format                                  Page
  2328.  
  2329. ALARM               ALARM                                   78
  2330. BEEP                BEEP                                    78
  2331. CALL                CALL label                              69
  2332. CAPTURE             CAPTURE "string"                        81
  2333. CLEAR               CLEAR                                   78
  2334. COMMANDMODE         COMMANDMODE state                       84
  2335. Comment             ;text                                   67
  2336. Control characters  ^                                       67
  2337. CURRENTLINEHAS      IF CURRENTLINEHAS "string"              73
  2338. DATAWAITING         IF DATAWAITING                          75
  2339. DAYOFWEEK           IF DAYOFWEEK day                        76
  2340. Delimiters          () [] {} <> `' ""                       67
  2341. ECHO                ECHO state                              77
  2342. ELSE                ELSE                                    71
  2343. ENDCAPTURE          ENDCAPTURE                              81
  2344. ENDIF               ENDIF                                   71
  2345. ENDSCRIPT           ENDSCRIPT                               68
  2346. ERASEFILE           ERASEFILE "string"                      80
  2347. EXIST               IF EXIST "string"                       75
  2348. GETKEY              GETKEY digit                            88
  2349. GETSTRING           GETSTRING digit                         89
  2350. GOTO                GOTO label                              68
  2351. HANGUP              HANGUP                                  85
  2352. HIDE                HIDE state                              78
  2353. IF                  IF condition                            71
  2354. KEYWAITING          IF KEYWAITING                           75
  2355. KEYWAITING          KEYWAITING state                        88
  2356. Label               :labelname                              68
  2357. LOG OFF             LOG OFF                                 83
  2358. LOG ON              LOG ON                                  83
  2359. LOG ONTO            LOG ONTO "string"                       83
  2360. MAILFOUND           IF MAILFOUND                            76
  2361. MONITOR             MONITOR                                 79
  2362. NOTE                NOTE "string"                           78
  2363. ONLINE              IF ONLINE                               73
  2364. PAUSE               PAUSE seconds                           79
  2365. PERFORM             PERFORM digit                           70
  2366. QUOTES              QUOTES state                            84
  2367. RETURN              RETURN                                  69
  2368. SCRIPT              SCRIPT digit text                       67
  2369. SEND                SEND "string"                           85
  2370. SENDCOMMAND         SENDCOMMAND "string"                    85
  2371. SENDLINE            SENDLINE "string"                       85
  2372. SENDSPECIALCOMMAND  SENDSPECIALCOMMAND "string" "prompt"    86
  2373. SETSTRING           SETSTRING digit "string"
  2374. SNAPSHOT            SNAPSHOT "string"                       82
  2375. STRING              IF STRING digit verb "string"           73
  2376. SUCCESS             IF SUCCESS                              72
  2377. SUCCESS             SUCCESS condition                       77
  2378. Variables           %digit                                  67
  2379. WAITFOR             WAITFOR "string"                        86
  2380. WAITFORDATA         WAITFORDATA keyword                     87
  2381. WAITFORKEYPRESS     WAITFORKEYPRESS                         88
  2382. WAITFORPROMPT       WAITFORPROMPT                           87
  2383. WAITUNTIL           WAITUNTIL HH:MM                         80
  2384. XMODEM              XMODEM direction "string"               82
  2385. ZMODEM              ZMODEM "string"                         82
  2386.  
  2387.  
  2388.                                 [*][*][*]
  2389.  
  2390.      Published online by:
  2391.  
  2392.                           T/TalkNET OnLine Publishing Co.
  2393.                           ATTEN: John Peters
  2394.                           5102 Galley Rd. 115/B
  2395.                           Colorado Springs, CO. 80915
  2396.  
  2397.  
  2398. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\//////////////////////////////////// 
  2399.  To sign up for GEnie service, call (with modem) 1-800-638-8369.   Upon 
  2400.  connection type HHH.  Wait for the  U#=  prompt.  Type: XJM11877,GEnie 
  2401.  and hit RETURN.  The system will then prompt you for your information. 
  2402. ////////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 
  2403. [EOF]
  2404.